From 41a387764033ba781118892e567b15968ef64735 Mon Sep 17 00:00:00 2001 From: Sebastian Goscik Date: Tue, 23 Feb 2016 10:59:32 +0000 Subject: [PATCH] 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