3Copyright (c) 2011-2015 ARM Limited
5Licensed under the Apache License, Version 2.0 (the "License");
6you may not use this file except in compliance with the License.
7You may obtain a copy of the License at
9 http://www.apache.org/licenses/LICENSE-2.0
11Unless required by applicable law or agreed to
in writing, software
12distributed under the License
is distributed on an
"AS IS" BASIS,
13WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
or implied.
14See the License
for the specific language governing permissions
and
15limitations under the License.
17Author: Przemyslaw Wirkus <Przemyslaw.Wirkus
@arm.com>
20from .host_test_plugins import HostTestPluginBase
23class HostTestPluginResetMethod_SiLabs(HostTestPluginBase):
26 name =
'HostTestPluginResetMethod_SiLabs'
28 capabilities = [
'eACommander',
'eACommander-usb']
29 required_parameters = [
'disk']
35 HostTestPluginBase.__init__(self)
37 def setup(self, *args, **kwargs):
38 """ Configure plugin, this function should be called before plugin execute() method is used.
44 def execute(self, capability, *args, **kwargs):
45 """! Executes capability by name
47 @param capability Capability name
48 @param args Additional arguments
49 @param kwargs Additional arguments
51 @details Each capability e.g. may directly just call some command line program
or execute building pythonic function
53 @return Capability call
return value
57 disk = kwargs[
'disk'].rstrip(
'/\\')
59 if capability ==
'eACommander':
64 '--resettype',
'2',
'--reset',]
66 elif capability ==
'eACommander-usb':
71 '--resettype',
'2',
'--reset',]
77 """ Returns plugin available in this module
def run_command(self, cmd, shell=True)
Runs command from command line.
def check_parameters(self, capability, *args, **kwargs)
This function should be ran each time we call execute() to check if none of the required parameters i...
def execute(self, capability, *args, **kwargs)
Executes capability by name.
def setup(self, *args, **kwargs)