summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/oetest.py
diff options
context:
space:
mode:
authorAníbal Limón <anibal.limon@linux.intel.com>2016-10-31 17:24:25 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-01-23 12:05:19 +0000
commit8a37763ae9e5b8bfa4ed89c2ab8642b8f5bfc287 (patch)
treed4af06c2d2efd97b340aa657959a7abca1af4a1a /meta/lib/oeqa/oetest.py
parent9a23e0f703ec3ccb99b354102d804eda13543b23 (diff)
downloadpoky-8a37763ae9e5b8bfa4ed89c2ab8642b8f5bfc287.tar.gz
oeqa/sdk: Add case and context modules for the SDK component
Adds case and context modules for SDK based on oetest.py old code. Enables SDK Test component usage with oe-test, the SDK Test component adds command line options for specify sdk installed dir, sdk environment and target/hosts maniftest. [YOCTO #10599] (From OE-Core rev: 19e875dd81c42841666e6db5f6b665b4e1cddfe6) Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/oetest.py')
-rw-r--r--meta/lib/oeqa/oetest.py51
1 files changed, 0 insertions, 51 deletions
diff --git a/meta/lib/oeqa/oetest.py b/meta/lib/oeqa/oetest.py
index d1aef967e4..d7c358844f 100644
--- a/meta/lib/oeqa/oetest.py
+++ b/meta/lib/oeqa/oetest.py
@@ -145,20 +145,6 @@ class OETestCalledProcessError(subprocess.CalledProcessError):
145 145
146subprocess.CalledProcessError = OETestCalledProcessError 146subprocess.CalledProcessError = OETestCalledProcessError
147 147
148class oeSDKTest(oeTest):
149 def __init__(self, methodName='runTest'):
150 self.sdktestdir = oeSDKTest.tc.sdktestdir
151 super(oeSDKTest, self).__init__(methodName)
152
153 @classmethod
154 def hasHostPackage(self, pkg):
155 if re.search(pkg, oeTest.tc.hostpkgmanifest):
156 return True
157 return False
158
159 def _run(self, cmd):
160 return subprocess.check_output(". %s > /dev/null; %s;" % (self.tc.sdkenv, cmd), shell=True, stderr=subprocess.STDOUT).decode("utf-8")
161
162class oeSDKExtTest(oeSDKTest): 148class oeSDKExtTest(oeSDKTest):
163 def _run(self, cmd): 149 def _run(self, cmd):
164 # extensible sdk shows a warning if found bitbake in the path 150 # extensible sdk shows a warning if found bitbake in the path
@@ -657,43 +643,6 @@ class ExportTestContext(RuntimeTestContext):
657 pkg_dir = os.path.join(export_dir, extracted_dir) 643 pkg_dir = os.path.join(export_dir, extracted_dir)
658 super(ExportTestContext, self).install_uninstall_packages(test_id, pkg_dir, install) 644 super(ExportTestContext, self).install_uninstall_packages(test_id, pkg_dir, install)
659 645
660class SDKTestContext(TestContext):
661 def __init__(self, d, sdktestdir, sdkenv, tcname, *args):
662 super(SDKTestContext, self).__init__(d)
663
664 self.sdktestdir = sdktestdir
665 self.sdkenv = sdkenv
666 self.tcname = tcname
667
668 if not hasattr(self, 'target_manifest'):
669 self.target_manifest = d.getVar("SDK_TARGET_MANIFEST")
670 try:
671 self.pkgmanifest = {}
672 with open(self.target_manifest) as f:
673 for line in f:
674 (pkg, arch, version) = line.strip().split()
675 self.pkgmanifest[pkg] = (version, arch)
676 except IOError as e:
677 bb.fatal("No package manifest file found. Did you build the sdk image?\n%s" % e)
678
679 if not hasattr(self, 'host_manifest'):
680 self.host_manifest = d.getVar("SDK_HOST_MANIFEST")
681 try:
682 with open(self.host_manifest) as f:
683 self.hostpkgmanifest = f.read()
684 except IOError as e:
685 bb.fatal("No host package manifest file found. Did you build the sdk image?\n%s" % e)
686
687 def _get_test_namespace(self):
688 return "sdk"
689
690 def _get_test_suites(self):
691 return (self.d.getVar("TEST_SUITES_SDK") or "auto").split()
692
693 def _get_test_suites_required(self):
694 return [t for t in (self.d.getVar("TEST_SUITES_SDK") or \
695 "auto").split() if t != "auto"]
696
697class SDKExtTestContext(SDKTestContext): 646class SDKExtTestContext(SDKTestContext):
698 def __init__(self, d, sdktestdir, sdkenv, tcname, *args): 647 def __init__(self, d, sdktestdir, sdkenv, tcname, *args):
699 self.target_manifest = d.getVar("SDK_EXT_TARGET_MANIFEST") 648 self.target_manifest = d.getVar("SDK_EXT_TARGET_MANIFEST")