aboutsummaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/runtime
diff options
context:
space:
mode:
authorAníbal Limón <anibal.limon@linux.intel.com>2016-12-05 11:43:21 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-01-23 12:03:56 +0000
commitf8beaf94e943a8b20d146be47a756af312ef107c (patch)
tree39add69db3a1c9856fa30fd5185531c486b8914f /meta/lib/oeqa/runtime
parent07ee2fa0008a50da87fd840aea5e8bb6051c68fa (diff)
downloadopenembedded-core-contrib-f8beaf94e943a8b20d146be47a756af312ef107c.tar.gz
oeqa/utils/dump: Move get_host_dumper to OERuntimeTestContextExecutor class
To avoid getVar calls inside a utils module, also moves get_host_dumper import inside testexport isn't needed. [YOCTO #10231] Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Diffstat (limited to 'meta/lib/oeqa/runtime')
-rw-r--r--meta/lib/oeqa/runtime/context.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/meta/lib/oeqa/runtime/context.py b/meta/lib/oeqa/runtime/context.py
index ec378bb016..ab7caa62c1 100644
--- a/meta/lib/oeqa/runtime/context.py
+++ b/meta/lib/oeqa/runtime/context.py
@@ -5,6 +5,8 @@ import os
from oeqa.core.context import OETestContext, OETestContextExecutor
from oeqa.core.target.ssh import OESSHTarget
+from oeqa.utils.dump import HostDumper
+
from oeqa.runtime.loader import OERuntimeTestLoader
class OERuntimeTestContext(OETestContext):
@@ -12,10 +14,11 @@ class OERuntimeTestContext(OETestContext):
runtime_files_dir = os.path.join(
os.path.dirname(os.path.abspath(__file__)), "files")
- def __init__(self, td, logger, target, image_packages):
+ def __init__(self, td, logger, target, host_dumper, image_packages):
super(OERuntimeTestContext, self).__init__(td, logger)
self.target = target
self.image_packages = image_packages
+ self.host_dumper = host_dumper
self._set_target_cmds()
def _set_target_cmds(self):
@@ -39,6 +42,7 @@ class OERuntimeTestContextExecutor(OETestContextExecutor):
default_target_type = 'simpleremote'
default_server_ip = '192.168.7.1'
default_target_ip = '192.168.7.2'
+ default_host_dumper_dir = '/tmp/oe-saved-tests'
def register_commands(self, logger, subparsers):
super(OERuntimeTestContextExecutor, self).register_commands(logger, subparsers)
@@ -58,6 +62,11 @@ class OERuntimeTestContextExecutor(OETestContextExecutor):
help="IP address of device under test, default: %s" \
% self.default_server_ip)
+ runtime_group.add_argument('--host-dumper-dir', action='store',
+ default=self.default_host_dumper_dir,
+ help="Directory where host status is dumped, if tests fails, default: %s" \
+ % self.default_host_dumper_dir)
+
runtime_group.add_argument('--packages-manifest', action='store',
help="Package manifest of the image under test")
@@ -90,6 +99,10 @@ class OERuntimeTestContextExecutor(OETestContextExecutor):
return image_packages
+ @staticmethod
+ def getHostDumper(cmds, directory):
+ return HostDumper(cmds, directory)
+
def _process_args(self, logger, args):
if not args.packages_manifest:
raise TypeError('Manifest file not provided')
@@ -98,6 +111,9 @@ class OERuntimeTestContextExecutor(OETestContextExecutor):
self.tc_kwargs['init']['target'] = \
OERuntimeTestContextExecutor.getTarget(args.target_type)
+ self.tc_kwargs['init']['host_dumper'] = \
+ OERuntimeTestContextExecutor.getHostDumper(None,
+ args.host_dumper_dir)
self.tc_kwargs['init']['image_packages'] = \
OERuntimeTestContextExecutor.readPackagesManifest(
args.packages_manifest)