mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-02-22 04:49:00 +00:00
Merge pull request #109 from ep1cman/locallinux
LocalLinuxManager: Added a local linux manager
This commit is contained in:
commit
a4a428c9ae
@ -53,14 +53,13 @@ sys.path.insert(0, os.path.join(_this_dir, '..', 'external'))
|
|||||||
|
|
||||||
#pylint: disable=C0326
|
#pylint: disable=C0326
|
||||||
_EXTENSION_TYPE_TABLE = [
|
_EXTENSION_TYPE_TABLE = [
|
||||||
# name, class, default package, default path
|
# name, class, default package, default path
|
||||||
('command', 'wlauto.core.command.Command', 'wlauto.commands', 'commands'),
|
('command', 'wlauto.core.command.Command', 'wlauto.commands', 'commands'),
|
||||||
('device_manager', 'wlauto.core.device.DeviceManager', 'wlauto.managers', 'devices'),
|
('device_manager', 'wlauto.core.device_manager.DeviceManager', 'wlauto.managers', 'managers'),
|
||||||
('instrument', 'wlauto.core.instrumentation.Instrument', 'wlauto.instrumentation', 'instruments'),
|
('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'),
|
||||||
('resource_getter', 'wlauto.core.resource.ResourceGetter', 'wlauto.resource_getters', 'resource_getters'),
|
('result_processor', 'wlauto.core.result.ResultProcessor', 'wlauto.result_processors', 'result_processors'),
|
||||||
('result_processor', 'wlauto.core.result.ResultProcessor', 'wlauto.result_processors', 'result_processors'),
|
('workload', 'wlauto.core.workload.Workload', 'wlauto.workloads', 'workloads'),
|
||||||
('workload', 'wlauto.core.workload.Workload', 'wlauto.workloads', 'workloads'),
|
|
||||||
]
|
]
|
||||||
_Extension = namedtuple('_Extension', 'name, cls, default_package, default_path')
|
_Extension = namedtuple('_Extension', 'name, cls, default_package, default_path')
|
||||||
_extensions = [_Extension._make(ext) for ext in _EXTENSION_TYPE_TABLE] # pylint: disable=W0212
|
_extensions = [_Extension._make(ext) for ext in _EXTENSION_TYPE_TABLE] # pylint: disable=W0212
|
||||||
|
30
wlauto/managers/locallinux.py
Normal file
30
wlauto/managers/locallinux.py
Normal file
@ -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
|
Loading…
x
Reference in New Issue
Block a user