From 19e875dd81c42841666e6db5f6b665b4e1cddfe6 Mon Sep 17 00:00:00 2001 From: Aníbal Limón Date: Mon, 31 Oct 2016 17:24:25 -0600 Subject: oeqa/sdk: Add case and context modules for the SDK component MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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] Signed-off-by: Aníbal Limón Signed-off-by: Mariano Lopez --- meta/lib/oeqa/oetest.py | 51 ------------------------------------------------- 1 file changed, 51 deletions(-) (limited to 'meta/lib/oeqa/oetest.py') 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): subprocess.CalledProcessError = OETestCalledProcessError -class oeSDKTest(oeTest): - def __init__(self, methodName='runTest'): - self.sdktestdir = oeSDKTest.tc.sdktestdir - super(oeSDKTest, self).__init__(methodName) - - @classmethod - def hasHostPackage(self, pkg): - if re.search(pkg, oeTest.tc.hostpkgmanifest): - return True - return False - - def _run(self, cmd): - return subprocess.check_output(". %s > /dev/null; %s;" % (self.tc.sdkenv, cmd), shell=True, stderr=subprocess.STDOUT).decode("utf-8") - class oeSDKExtTest(oeSDKTest): def _run(self, cmd): # extensible sdk shows a warning if found bitbake in the path @@ -657,43 +643,6 @@ class ExportTestContext(RuntimeTestContext): pkg_dir = os.path.join(export_dir, extracted_dir) super(ExportTestContext, self).install_uninstall_packages(test_id, pkg_dir, install) -class SDKTestContext(TestContext): - def __init__(self, d, sdktestdir, sdkenv, tcname, *args): - super(SDKTestContext, self).__init__(d) - - self.sdktestdir = sdktestdir - self.sdkenv = sdkenv - self.tcname = tcname - - if not hasattr(self, 'target_manifest'): - self.target_manifest = d.getVar("SDK_TARGET_MANIFEST") - try: - self.pkgmanifest = {} - with open(self.target_manifest) as f: - for line in f: - (pkg, arch, version) = line.strip().split() - self.pkgmanifest[pkg] = (version, arch) - except IOError as e: - bb.fatal("No package manifest file found. Did you build the sdk image?\n%s" % e) - - if not hasattr(self, 'host_manifest'): - self.host_manifest = d.getVar("SDK_HOST_MANIFEST") - try: - with open(self.host_manifest) as f: - self.hostpkgmanifest = f.read() - except IOError as e: - bb.fatal("No host package manifest file found. Did you build the sdk image?\n%s" % e) - - def _get_test_namespace(self): - return "sdk" - - def _get_test_suites(self): - return (self.d.getVar("TEST_SUITES_SDK") or "auto").split() - - def _get_test_suites_required(self): - return [t for t in (self.d.getVar("TEST_SUITES_SDK") or \ - "auto").split() if t != "auto"] - class SDKExtTestContext(SDKTestContext): def __init__(self, d, sdktestdir, sdkenv, tcname, *args): self.target_manifest = d.getVar("SDK_EXT_TARGET_MANIFEST") -- cgit 1.2.3-korg