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.py60
1 files changed, 30 insertions, 30 deletions
diff --git a/meta/lib/oeqa/oetest.py b/meta/lib/oeqa/oetest.py
index 95d3bf72fc..d1aef967e4 100644
--- a/meta/lib/oeqa/oetest.py
+++ b/meta/lib/oeqa/oetest.py
@@ -221,15 +221,15 @@ class TestContext(object):
221 path = [os.path.dirname(os.path.abspath(__file__))] 221 path = [os.path.dirname(os.path.abspath(__file__))]
222 extrapath = "" 222 extrapath = ""
223 else: 223 else:
224 path = d.getVar("BBPATH", True).split(':') 224 path = d.getVar("BBPATH").split(':')
225 extrapath = "lib/oeqa" 225 extrapath = "lib/oeqa"
226 226
227 self.testslist = self._get_tests_list(path, extrapath) 227 self.testslist = self._get_tests_list(path, extrapath)
228 self.testsrequired = self._get_test_suites_required() 228 self.testsrequired = self._get_test_suites_required()
229 229
230 self.filesdir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "runtime/files") 230 self.filesdir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "runtime/files")
231 self.imagefeatures = d.getVar("IMAGE_FEATURES", True).split() 231 self.imagefeatures = d.getVar("IMAGE_FEATURES").split()
232 self.distrofeatures = d.getVar("DISTRO_FEATURES", True).split() 232 self.distrofeatures = d.getVar("DISTRO_FEATURES").split()
233 233
234 # get testcase list from specified file 234 # get testcase list from specified file
235 # if path is a relative path, then relative to build/conf/ 235 # if path is a relative path, then relative to build/conf/
@@ -406,9 +406,9 @@ class RuntimeTestContext(TestContext):
406 self.target = target 406 self.target = target
407 407
408 self.pkgmanifest = {} 408 self.pkgmanifest = {}
409 manifest = os.path.join(d.getVar("DEPLOY_DIR_IMAGE", True), 409 manifest = os.path.join(d.getVar("DEPLOY_DIR_IMAGE"),
410 d.getVar("IMAGE_LINK_NAME", True) + ".manifest") 410 d.getVar("IMAGE_LINK_NAME") + ".manifest")
411 nomanifest = d.getVar("IMAGE_NO_MANIFEST", True) 411 nomanifest = d.getVar("IMAGE_NO_MANIFEST")
412 if nomanifest is None or nomanifest != "1": 412 if nomanifest is None or nomanifest != "1":
413 try: 413 try:
414 with open(manifest) as f: 414 with open(manifest) as f:
@@ -424,19 +424,19 @@ class RuntimeTestContext(TestContext):
424 def _get_test_suites(self): 424 def _get_test_suites(self):
425 testsuites = [] 425 testsuites = []
426 426
427 manifests = (self.d.getVar("TEST_SUITES_MANIFEST", True) or '').split() 427 manifests = (self.d.getVar("TEST_SUITES_MANIFEST") or '').split()
428 if manifests: 428 if manifests:
429 for manifest in manifests: 429 for manifest in manifests:
430 testsuites.extend(self._read_testlist(manifest, 430 testsuites.extend(self._read_testlist(manifest,
431 self.d.getVar("TOPDIR", True)).split()) 431 self.d.getVar("TOPDIR")).split())
432 432
433 else: 433 else:
434 testsuites = self.d.getVar("TEST_SUITES", True).split() 434 testsuites = self.d.getVar("TEST_SUITES").split()
435 435
436 return testsuites 436 return testsuites
437 437
438 def _get_test_suites_required(self): 438 def _get_test_suites_required(self):
439 return [t for t in self.d.getVar("TEST_SUITES", True).split() if t != "auto"] 439 return [t for t in self.d.getVar("TEST_SUITES").split() if t != "auto"]
440 440
441 def loadTests(self): 441 def loadTests(self):
442 super(RuntimeTestContext, self).loadTests() 442 super(RuntimeTestContext, self).loadTests()
@@ -449,10 +449,10 @@ class RuntimeTestContext(TestContext):
449 """ 449 """
450 450
451 modules = self.getTestModules() 451 modules = self.getTestModules()
452 bbpaths = self.d.getVar("BBPATH", True).split(":") 452 bbpaths = self.d.getVar("BBPATH").split(":")
453 453
454 shutil.rmtree(self.d.getVar("TEST_EXTRACTED_DIR", True)) 454 shutil.rmtree(self.d.getVar("TEST_EXTRACTED_DIR"))
455 shutil.rmtree(self.d.getVar("TEST_PACKAGED_DIR", True)) 455 shutil.rmtree(self.d.getVar("TEST_PACKAGED_DIR"))
456 for module in modules: 456 for module in modules:
457 json_file = self._getJsonFile(module) 457 json_file = self._getJsonFile(module)
458 if json_file: 458 if json_file:
@@ -466,8 +466,8 @@ class RuntimeTestContext(TestContext):
466 466
467 import oe.path 467 import oe.path
468 468
469 extracted_path = self.d.getVar("TEST_EXTRACTED_DIR", True) 469 extracted_path = self.d.getVar("TEST_EXTRACTED_DIR")
470 packaged_path = self.d.getVar("TEST_PACKAGED_DIR", True) 470 packaged_path = self.d.getVar("TEST_PACKAGED_DIR")
471 471
472 for key,value in needed_packages.items(): 472 for key,value in needed_packages.items():
473 packages = () 473 packages = ()
@@ -548,7 +548,7 @@ class RuntimeTestContext(TestContext):
548 548
549 from oeqa.utils.package_manager import get_package_manager 549 from oeqa.utils.package_manager import get_package_manager
550 550
551 pkg_path = os.path.join(self.d.getVar("TEST_INSTALL_TMP_DIR", True), pkg) 551 pkg_path = os.path.join(self.d.getVar("TEST_INSTALL_TMP_DIR"), pkg)
552 pm = get_package_manager(self.d, pkg_path) 552 pm = get_package_manager(self.d, pkg_path)
553 extract_dir = pm.extract(pkg) 553 extract_dir = pm.extract(pkg)
554 shutil.rmtree(pkg_path) 554 shutil.rmtree(pkg_path)
@@ -562,8 +562,8 @@ class RuntimeTestContext(TestContext):
562 562
563 from oeqa.utils.package_manager import get_package_manager 563 from oeqa.utils.package_manager import get_package_manager
564 564
565 pkg_path = os.path.join(self.d.getVar("TEST_INSTALL_TMP_DIR", True), pkg) 565 pkg_path = os.path.join(self.d.getVar("TEST_INSTALL_TMP_DIR"), pkg)
566 dst_dir = self.d.getVar("TEST_PACKAGED_DIR", True) 566 dst_dir = self.d.getVar("TEST_PACKAGED_DIR")
567 pm = get_package_manager(self.d, pkg_path) 567 pm = get_package_manager(self.d, pkg_path)
568 pkg_info = pm.package_info(pkg) 568 pkg_info = pm.package_info(pkg)
569 file_path = pkg_info[pkg]["filepath"] 569 file_path = pkg_info[pkg]["filepath"]
@@ -611,7 +611,7 @@ class ImageTestContext(RuntimeTestContext):
611 def __init__(self, d, target, host_dumper): 611 def __init__(self, d, target, host_dumper):
612 super(ImageTestContext, self).__init__(d, target) 612 super(ImageTestContext, self).__init__(d, target)
613 613
614 self.tagexp = d.getVar("TEST_SUITES_TAGS", True) 614 self.tagexp = d.getVar("TEST_SUITES_TAGS")
615 615
616 self.host_dumper = host_dumper 616 self.host_dumper = host_dumper
617 617
@@ -629,7 +629,7 @@ class ImageTestContext(RuntimeTestContext):
629 Check if the test requires a package and Install/Unistall it in the DUT 629 Check if the test requires a package and Install/Unistall it in the DUT
630 """ 630 """
631 631
632 pkg_dir = self.d.getVar("TEST_EXTRACTED_DIR", True) 632 pkg_dir = self.d.getVar("TEST_EXTRACTED_DIR")
633 super(ImageTestContext, self).install_uninstall_packages(test_id, pkg_dir, install) 633 super(ImageTestContext, self).install_uninstall_packages(test_id, pkg_dir, install)
634 634
635class ExportTestContext(RuntimeTestContext): 635class ExportTestContext(RuntimeTestContext):
@@ -643,7 +643,7 @@ class ExportTestContext(RuntimeTestContext):
643 super(ExportTestContext, self).__init__(d, target, exported) 643 super(ExportTestContext, self).__init__(d, target, exported)
644 644
645 tag = parsedArgs.get("tag", None) 645 tag = parsedArgs.get("tag", None)
646 self.tagexp = tag if tag != None else d.getVar("TEST_SUITES_TAGS", True) 646 self.tagexp = tag if tag != None else d.getVar("TEST_SUITES_TAGS")
647 647
648 self.sigterm = None 648 self.sigterm = None
649 649
@@ -653,7 +653,7 @@ class ExportTestContext(RuntimeTestContext):
653 """ 653 """
654 654
655 export_dir = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) 655 export_dir = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
656 extracted_dir = self.d.getVar("TEST_EXPORT_EXTRACTED_DIR", True) 656 extracted_dir = self.d.getVar("TEST_EXPORT_EXTRACTED_DIR")
657 pkg_dir = os.path.join(export_dir, extracted_dir) 657 pkg_dir = os.path.join(export_dir, extracted_dir)
658 super(ExportTestContext, self).install_uninstall_packages(test_id, pkg_dir, install) 658 super(ExportTestContext, self).install_uninstall_packages(test_id, pkg_dir, install)
659 659
@@ -666,7 +666,7 @@ class SDKTestContext(TestContext):
666 self.tcname = tcname 666 self.tcname = tcname
667 667
668 if not hasattr(self, 'target_manifest'): 668 if not hasattr(self, 'target_manifest'):
669 self.target_manifest = d.getVar("SDK_TARGET_MANIFEST", True) 669 self.target_manifest = d.getVar("SDK_TARGET_MANIFEST")
670 try: 670 try:
671 self.pkgmanifest = {} 671 self.pkgmanifest = {}
672 with open(self.target_manifest) as f: 672 with open(self.target_manifest) as f:
@@ -677,7 +677,7 @@ class SDKTestContext(TestContext):
677 bb.fatal("No package manifest file found. Did you build the sdk image?\n%s" % e) 677 bb.fatal("No package manifest file found. Did you build the sdk image?\n%s" % e)
678 678
679 if not hasattr(self, 'host_manifest'): 679 if not hasattr(self, 'host_manifest'):
680 self.host_manifest = d.getVar("SDK_HOST_MANIFEST", True) 680 self.host_manifest = d.getVar("SDK_HOST_MANIFEST")
681 try: 681 try:
682 with open(self.host_manifest) as f: 682 with open(self.host_manifest) as f:
683 self.hostpkgmanifest = f.read() 683 self.hostpkgmanifest = f.read()
@@ -688,16 +688,16 @@ class SDKTestContext(TestContext):
688 return "sdk" 688 return "sdk"
689 689
690 def _get_test_suites(self): 690 def _get_test_suites(self):
691 return (self.d.getVar("TEST_SUITES_SDK", True) or "auto").split() 691 return (self.d.getVar("TEST_SUITES_SDK") or "auto").split()
692 692
693 def _get_test_suites_required(self): 693 def _get_test_suites_required(self):
694 return [t for t in (self.d.getVar("TEST_SUITES_SDK", True) or \ 694 return [t for t in (self.d.getVar("TEST_SUITES_SDK") or \
695 "auto").split() if t != "auto"] 695 "auto").split() if t != "auto"]
696 696
697class SDKExtTestContext(SDKTestContext): 697class SDKExtTestContext(SDKTestContext):
698 def __init__(self, d, sdktestdir, sdkenv, tcname, *args): 698 def __init__(self, d, sdktestdir, sdkenv, tcname, *args):
699 self.target_manifest = d.getVar("SDK_EXT_TARGET_MANIFEST", True) 699 self.target_manifest = d.getVar("SDK_EXT_TARGET_MANIFEST")
700 self.host_manifest = d.getVar("SDK_EXT_HOST_MANIFEST", True) 700 self.host_manifest = d.getVar("SDK_EXT_HOST_MANIFEST")
701 if args: 701 if args:
702 self.cm = args[0] # Compatibility mode for run SDK tests 702 self.cm = args[0] # Compatibility mode for run SDK tests
703 else: 703 else:
@@ -715,8 +715,8 @@ class SDKExtTestContext(SDKTestContext):
715 return "sdkext" 715 return "sdkext"
716 716
717 def _get_test_suites(self): 717 def _get_test_suites(self):
718 return (self.d.getVar("TEST_SUITES_SDK_EXT", True) or "auto").split() 718 return (self.d.getVar("TEST_SUITES_SDK_EXT") or "auto").split()
719 719
720 def _get_test_suites_required(self): 720 def _get_test_suites_required(self):
721 return [t for t in (self.d.getVar("TEST_SUITES_SDK_EXT", True) or \ 721 return [t for t in (self.d.getVar("TEST_SUITES_SDK_EXT") or \
722 "auto").split() if t != "auto"] 722 "auto").split() if t != "auto"]