From 41a387764033ba781118892e567b15968ef64735 Mon Sep 17 00:00:00 2001 From: Sebastian Goscik Date: Tue, 23 Feb 2016 10:59:32 +0000 Subject: [PATCH 1/2] LocalLinuxManager: Added a local linux manager This allows WA to automate the machine it is running on. --- wlauto/managers/locallinux.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 wlauto/managers/locallinux.py diff --git a/wlauto/managers/locallinux.py b/wlauto/managers/locallinux.py new file mode 100644 index 00000000..8f1c1297 --- /dev/null +++ b/wlauto/managers/locallinux.py @@ -0,0 +1,30 @@ +from wlauto.core.device_manager import DeviceManager +from wlauto import Parameter + +from devlib.target import LocalLinuxTarget + + +class LocalLinuxManager(DeviceManager): + + name = "local_linux" + target_type = LocalLinuxTarget + + parameters = [ + Parameter('password', + description='Password for the user.'), + ] + + def __init__(self, **kwargs): + super(LocalLinuxManager, self).__init__(**kwargs) + self.platform = self.platform_type(core_names=self.core_names, # pylint: disable=E1102 + core_clusters=self.core_clusters, + modules=self.modules) + self.target = self.target_type(connection_settings=self._make_connection_settings()) + + def connect(self): + self.target.connect() + + def _make_connection_settings(self): + connection_settings = {} + connection_settings['password'] = self.password + return connection_settings From d89a52584b2e8b0e268336162be475fcb1242d57 Mon Sep 17 00:00:00 2001 From: Sebastian Goscik Date: Tue, 23 Feb 2016 16:55:46 +0000 Subject: [PATCH 2/2] bootstrap: Removed and fixed module mapping for extensions --- wlauto/core/bootstrap.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/wlauto/core/bootstrap.py b/wlauto/core/bootstrap.py index e6fef47d..6d2de25e 100644 --- a/wlauto/core/bootstrap.py +++ b/wlauto/core/bootstrap.py @@ -53,14 +53,13 @@ sys.path.insert(0, os.path.join(_this_dir, '..', 'external')) #pylint: disable=C0326 _EXTENSION_TYPE_TABLE = [ - # name, class, default package, default path - ('command', 'wlauto.core.command.Command', 'wlauto.commands', 'commands'), - ('device_manager', 'wlauto.core.device.DeviceManager', 'wlauto.managers', 'devices'), - ('instrument', 'wlauto.core.instrumentation.Instrument', 'wlauto.instrumentation', 'instruments'), - ('module', 'wlauto.core.extension.Module', 'wlauto.modules', 'modules'), - ('resource_getter', 'wlauto.core.resource.ResourceGetter', 'wlauto.resource_getters', 'resource_getters'), - ('result_processor', 'wlauto.core.result.ResultProcessor', 'wlauto.result_processors', 'result_processors'), - ('workload', 'wlauto.core.workload.Workload', 'wlauto.workloads', 'workloads'), + # name, class, default package, default path + ('command', 'wlauto.core.command.Command', 'wlauto.commands', 'commands'), + ('device_manager', 'wlauto.core.device_manager.DeviceManager', 'wlauto.managers', 'managers'), + ('instrument', 'wlauto.core.instrumentation.Instrument', 'wlauto.instrumentation', 'instruments'), + ('resource_getter', 'wlauto.core.resource.ResourceGetter', 'wlauto.resource_getters', 'resource_getters'), + ('result_processor', 'wlauto.core.result.ResultProcessor', 'wlauto.result_processors', 'result_processors'), + ('workload', 'wlauto.core.workload.Workload', 'wlauto.workloads', 'workloads'), ] _Extension = namedtuple('_Extension', 'name, cls, default_package, default_path') _extensions = [_Extension._make(ext) for ext in _EXTENSION_TYPE_TABLE] # pylint: disable=W0212