]>
git.gir.st - tmk_keyboard.git/blob - tool/mbed/mbed-sdk/workspace_tools/host_tests/host_tests_plugins/module_reset_mps2.py
3 Copyright (c) 2011-2013 ARM Limited
5 Licensed under the Apache License, Version 2.0 (the "License");
6 you may not use this file except in compliance with the License.
7 You may obtain a copy of the License at
9 http://www.apache.org/licenses/LICENSE-2.0
11 Unless required by applicable law or agreed to in writing, software
12 distributed under the License is distributed on an "AS IS" BASIS,
13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 See the License for the specific language governing permissions and
15 limitations under the License.
19 from host_test_plugins
import HostTestPluginBase
21 # Note: This plugin is not fully functional, needs improvements
23 class HostTestPluginResetMethod_MPS2(HostTestPluginBase
):
24 """ Plugin used to reset ARM_MPS2 platform
26 reboot.txt - startup from standby state, reboots when in run mode.
27 shutdown.txt - shutdown from run mode.
28 reset.txt - reset FPGA during run mode.
30 def touch_file(self
, path
):
31 """ Touch file and set timestamp to items
37 name
= 'HostTestPluginResetMethod_MPS2'
39 capabilities
= ['reboot.txt', 'shutdown.txt', 'reset.txt']
40 required_parameters
= ['disk']
42 def setup(self
, *args
, **kwargs
):
43 """ Prepare / configure plugin to work.
44 This method can receive plugin specific parameters by kwargs and
45 ignore other parameters which may affect other plugins.
49 def execute(self
, capabilitity
, *args
, **kwargs
):
50 """ Executes capability by name.
51 Each capability may directly just call some command line
52 program or execute building pythonic function
55 if self
.check_parameters(capabilitity
, *args
, **kwargs
) is True:
57 if capabilitity
== 'reboot.txt':
58 # TODO: Implement touch file for reboot
61 elif capabilitity
== 'shutdown.txt':
62 # TODO: Implement touch file for shutdown
65 elif capabilitity
== 'reset.txt':
66 # TODO: Implement touch file for reset
72 """ Returns plugin available in this module
74 return HostTestPluginResetMethod_MPS2()