mirror of
https://github.com/ARM-software/workload-automation.git
synced 2025-04-15 07:10:56 +01:00
framework: pep8 fixes
Fix issues reported by flake8.
This commit is contained in:
parent
88c5005b38
commit
03eafe6b33
@ -144,12 +144,14 @@ class LoggingConfig(dict):
|
|||||||
def to_pod(self):
|
def to_pod(self):
|
||||||
return self
|
return self
|
||||||
|
|
||||||
|
|
||||||
def expanded_path(path):
|
def expanded_path(path):
|
||||||
"""
|
"""
|
||||||
Ensure that the provided path has been expanded if applicable
|
Ensure that the provided path has been expanded if applicable
|
||||||
"""
|
"""
|
||||||
return os.path.expanduser(str(path))
|
return os.path.expanduser(str(path))
|
||||||
|
|
||||||
|
|
||||||
def get_type_name(kind):
|
def get_type_name(kind):
|
||||||
typename = str(kind)
|
typename = str(kind)
|
||||||
if '\'' in typename:
|
if '\'' in typename:
|
||||||
@ -382,7 +384,6 @@ class Configuration(object):
|
|||||||
msg = 'Invalid value "{}" for "{}": {}'
|
msg = 'Invalid value "{}" for "{}": {}'
|
||||||
raise ConfigError(msg.format(value, name, e))
|
raise ConfigError(msg.format(value, name, e))
|
||||||
|
|
||||||
|
|
||||||
def update_config(self, values, check_mandatory=True):
|
def update_config(self, values, check_mandatory=True):
|
||||||
for k, v in values.items():
|
for k, v in values.items():
|
||||||
self.set(k, v, check_mandatory=check_mandatory)
|
self.set(k, v, check_mandatory=check_mandatory)
|
||||||
@ -899,7 +900,6 @@ class JobSpec(Configuration):
|
|||||||
self.label = self.workload_name
|
self.label = self.workload_name
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# This is used to construct the list of Jobs WA will run
|
# This is used to construct the list of Jobs WA will run
|
||||||
class JobGenerator(object):
|
class JobGenerator(object):
|
||||||
|
|
||||||
|
@ -18,12 +18,14 @@ from wa.framework.configuration.plugin_cache import PluginCache
|
|||||||
from wa.utils.serializer import yaml
|
from wa.utils.serializer import yaml
|
||||||
from wa.utils.doc import strip_inlined_text
|
from wa.utils.doc import strip_inlined_text
|
||||||
|
|
||||||
DEFAULT_AUGMENTATIONS = ['execution_time',
|
|
||||||
|
DEFAULT_AUGMENTATIONS = [
|
||||||
|
'execution_time',
|
||||||
'interrupts',
|
'interrupts',
|
||||||
'cpufreq',
|
'cpufreq',
|
||||||
'status',
|
'status',
|
||||||
'csv'
|
'csv',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
def _format_yaml_comment(param, short_description=False):
|
def _format_yaml_comment(param, short_description=False):
|
||||||
|
@ -84,7 +84,6 @@ class ConfigParser(object):
|
|||||||
log.dedent()
|
log.dedent()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class AgendaParser(object):
|
class AgendaParser(object):
|
||||||
|
|
||||||
def load_from_path(self, state, filepath):
|
def load_from_path(self, state, filepath):
|
||||||
@ -244,7 +243,7 @@ def merge_augmentations(raw):
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
cfg_point = JobSpec.configuration['augmentations']
|
cfg_point = JobSpec.configuration['augmentations']
|
||||||
names = [cfg_point.name,] + cfg_point.aliases
|
names = [cfg_point.name, ] + cfg_point.aliases
|
||||||
|
|
||||||
entries = []
|
entries = []
|
||||||
for n in names:
|
for n in names:
|
||||||
@ -253,9 +252,9 @@ def merge_augmentations(raw):
|
|||||||
value = raw.pop(n)
|
value = raw.pop(n)
|
||||||
try:
|
try:
|
||||||
entries.append(toggle_set(value))
|
entries.append(toggle_set(value))
|
||||||
except TypeError as e:
|
except TypeError as exc:
|
||||||
msg = 'Invalid value "{}" for "{}": {}'
|
msg = 'Invalid value "{}" for "{}": {}'
|
||||||
raise ConfigError(msg.format(value, n, e))
|
raise ConfigError(msg.format(value, n, exc))
|
||||||
|
|
||||||
# Make sure none of the specified aliases conflict with each other
|
# Make sure none of the specified aliases conflict with each other
|
||||||
to_check = [e for e in entries]
|
to_check = [e for e in entries]
|
||||||
|
@ -270,7 +270,6 @@ class PluginCache(object):
|
|||||||
raise AttributeError(name)
|
raise AttributeError(name)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class MergeState(object):
|
class MergeState(object):
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
@ -25,8 +25,8 @@ from datetime import datetime
|
|||||||
import wa.framework.signal as signal
|
import wa.framework.signal as signal
|
||||||
from wa.framework import instrument
|
from wa.framework import instrument
|
||||||
from wa.framework.configuration.core import Status
|
from wa.framework.configuration.core import Status
|
||||||
from wa.framework.exception import TargetError, HostError, WorkloadError,\
|
from wa.framework.exception import TargetError, HostError, WorkloadError
|
||||||
TargetNotRespondingError, TimeoutError
|
from wa.framework.exception import TargetNotRespondingError, TimeoutError
|
||||||
from wa.framework.job import Job
|
from wa.framework.job import Job
|
||||||
from wa.framework.output import init_job_output
|
from wa.framework.output import init_job_output
|
||||||
from wa.framework.output_processor import ProcessorManager
|
from wa.framework.output_processor import ProcessorManager
|
||||||
@ -130,8 +130,8 @@ class ExecutionContext(object):
|
|||||||
self.run_state.status = status
|
self.run_state.status = status
|
||||||
self.run_output.status = status
|
self.run_output.status = status
|
||||||
self.run_output.info.end_time = datetime.utcnow()
|
self.run_output.info.end_time = datetime.utcnow()
|
||||||
self.run_output.info.duration = self.run_output.info.end_time -\
|
self.run_output.info.duration = (self.run_output.info.end_time -
|
||||||
self.run_output.info.start_time
|
self.run_output.info.start_time)
|
||||||
self.write_output()
|
self.write_output()
|
||||||
|
|
||||||
def finalize(self):
|
def finalize(self):
|
||||||
|
@ -86,18 +86,23 @@ def convert_wa2_agenda(filepath, output_path):
|
|||||||
# Add additional config points to extract from config file.
|
# Add additional config points to extract from config file.
|
||||||
# Also allows for aliasing of renamed parameters
|
# Also allows for aliasing of renamed parameters
|
||||||
config_points.extend([
|
config_points.extend([
|
||||||
ConfigurationPoint('augmentations',
|
ConfigurationPoint(
|
||||||
|
'augmentations',
|
||||||
aliases=["instruments", "processors", "instrumentation",
|
aliases=["instruments", "processors", "instrumentation",
|
||||||
"output_processors", "augment", "result_processors"],
|
"output_processors", "augment", "result_processors"],
|
||||||
description='''The augmentations enabled by default.
|
description='''
|
||||||
|
The augmentations enabled by default.
|
||||||
This combines the "instrumentation"
|
This combines the "instrumentation"
|
||||||
and "result_processors" from previous
|
and "result_processors" from previous
|
||||||
versions of WA (the old entries are
|
versions of WA (the old entries are
|
||||||
now aliases for this).'''),
|
now aliases for this).
|
||||||
ConfigurationPoint('device_config',
|
'''),
|
||||||
|
ConfigurationPoint(
|
||||||
|
'device_config',
|
||||||
description='''Generic configuration for device.''',
|
description='''Generic configuration for device.''',
|
||||||
default={}),
|
default={}),
|
||||||
ConfigurationPoint('cleanup_assets',
|
ConfigurationPoint(
|
||||||
|
'cleanup_assets',
|
||||||
aliases=['clean_up'],
|
aliases=['clean_up'],
|
||||||
description='''Specify whether to clean up assets
|
description='''Specify whether to clean up assets
|
||||||
deployed to the target''',
|
deployed to the target''',
|
||||||
@ -137,6 +142,6 @@ def convert_wa2_agenda(filepath, output_path):
|
|||||||
|
|
||||||
def format_parameter(param):
|
def format_parameter(param):
|
||||||
if isinstance(param, dict):
|
if isinstance(param, dict):
|
||||||
return {identifier(k) : v for k, v in param.items()}
|
return {identifier(k): v for k, v in param.items()}
|
||||||
else:
|
else:
|
||||||
return param
|
return param
|
||||||
|
@ -13,6 +13,9 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
# Because of use of Enum (dynamic attrs)
|
||||||
|
# pylint: disable=no-member
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
from copy import copy
|
from copy import copy
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
@ -21,8 +24,6 @@ from wa.framework import pluginloader, signal, instrument
|
|||||||
from wa.framework.configuration.core import Status
|
from wa.framework.configuration.core import Status
|
||||||
from wa.utils.log import indentcontext
|
from wa.utils.log import indentcontext
|
||||||
|
|
||||||
# Because of use of Enum (dynamic attrs)
|
|
||||||
# pylint: disable=no-member
|
|
||||||
|
|
||||||
class Job(object):
|
class Job(object):
|
||||||
|
|
||||||
|
@ -119,7 +119,6 @@ class Output(object):
|
|||||||
self.result.status = Status.UNKNOWN
|
self.result.status = Status.UNKNOWN
|
||||||
self.add_event(str(e))
|
self.add_event(str(e))
|
||||||
|
|
||||||
|
|
||||||
def write_result(self):
|
def write_result(self):
|
||||||
write_pod(self.result.to_pod(), self.resultfile)
|
write_pod(self.result.to_pod(), self.resultfile)
|
||||||
|
|
||||||
@ -167,7 +166,6 @@ class Output(object):
|
|||||||
return os.path.basename(self.basepath)
|
return os.path.basename(self.basepath)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class RunOutput(Output):
|
class RunOutput(Output):
|
||||||
|
|
||||||
kind = 'run'
|
kind = 'run'
|
||||||
|
@ -316,8 +316,8 @@ class Plugin(with_metaclass(PluginMeta, object)):
|
|||||||
appropriate exception.
|
appropriate exception.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
modules = list(reversed(self.core_modules)) +\
|
modules = list(reversed(self.core_modules))
|
||||||
list(reversed(self.modules or []))
|
modules += list(reversed(self.modules or []))
|
||||||
if not modules:
|
if not modules:
|
||||||
return
|
return
|
||||||
for module_spec in modules:
|
for module_spec in modules:
|
||||||
|
@ -27,7 +27,6 @@ from wa.utils.misc import get_object_name
|
|||||||
from wa.utils.types import enum, list_or_string, prioritylist
|
from wa.utils.types import enum, list_or_string, prioritylist
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
SourcePriority = enum(['package', 'remote', 'lan', 'local',
|
SourcePriority = enum(['package', 'remote', 'lan', 'local',
|
||||||
'perferred'], start=0, step=10)
|
'perferred'], start=0, step=10)
|
||||||
|
|
||||||
@ -175,7 +174,6 @@ class ApkFile(Resource):
|
|||||||
uiauto_matches and package_matches and \
|
uiauto_matches and package_matches and \
|
||||||
abi_matches
|
abi_matches
|
||||||
|
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
text = '<{}\'s apk'.format(self.owner)
|
text = '<{}\'s apk'.format(self.owner)
|
||||||
if self.variant:
|
if self.variant:
|
||||||
@ -280,6 +278,7 @@ def apk_version_matches(path, version):
|
|||||||
return True
|
return True
|
||||||
return loose_version_matching(version, info.version_name)
|
return loose_version_matching(version, info.version_name)
|
||||||
|
|
||||||
|
|
||||||
def loose_version_matching(config_version, apk_version):
|
def loose_version_matching(config_version, apk_version):
|
||||||
config_version = config_version.split('.')
|
config_version = config_version.split('.')
|
||||||
apk_version = apk_version.split('.')
|
apk_version = apk_version.split('.')
|
||||||
@ -301,14 +300,17 @@ def file_name_matches(path, pattern):
|
|||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
def uiauto_test_matches(path, uiauto):
|
def uiauto_test_matches(path, uiauto):
|
||||||
info = ApkInfo(path)
|
info = ApkInfo(path)
|
||||||
return uiauto == ('com.arm.wa.uiauto' in info.package)
|
return uiauto == ('com.arm.wa.uiauto' in info.package)
|
||||||
|
|
||||||
|
|
||||||
def package_name_matches(path, package):
|
def package_name_matches(path, package):
|
||||||
info = ApkInfo(path)
|
info = ApkInfo(path)
|
||||||
return info.package == package
|
return info.package == package
|
||||||
|
|
||||||
|
|
||||||
def apk_abi_matches(path, supported_abi, exact_abi=False):
|
def apk_abi_matches(path, supported_abi, exact_abi=False):
|
||||||
supported_abi = list_or_string(supported_abi)
|
supported_abi = list_or_string(supported_abi)
|
||||||
info = ApkInfo(path)
|
info = ApkInfo(path)
|
||||||
|
@ -12,6 +12,10 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
# Because of use of Enum (dynamic attrs)
|
||||||
|
# pylint: disable=no-member
|
||||||
|
|
||||||
import uuid
|
import uuid
|
||||||
from collections import OrderedDict, Counter
|
from collections import OrderedDict, Counter
|
||||||
from copy import copy
|
from copy import copy
|
||||||
@ -19,8 +23,6 @@ from datetime import datetime, timedelta
|
|||||||
|
|
||||||
from wa.framework.configuration.core import Status
|
from wa.framework.configuration.core import Status
|
||||||
|
|
||||||
# Because of use of Enum (dynamic attrs)
|
|
||||||
# pylint: disable=no-member
|
|
||||||
|
|
||||||
class RunInfo(object):
|
class RunInfo(object):
|
||||||
"""
|
"""
|
||||||
@ -36,8 +38,7 @@ class RunInfo(object):
|
|||||||
uid = uuid.UUID(uid)
|
uid = uuid.UUID(uid)
|
||||||
instance = RunInfo(**pod)
|
instance = RunInfo(**pod)
|
||||||
instance.uuid = uid
|
instance.uuid = uid
|
||||||
instance.duration = duration if duration is None else\
|
instance.duration = duration if duration is None else timedelta(seconds=duration)
|
||||||
timedelta(seconds=duration)
|
|
||||||
return instance
|
return instance
|
||||||
|
|
||||||
def __init__(self, run_name=None, project=None, project_stage=None,
|
def __init__(self, run_name=None, project=None, project_stage=None,
|
||||||
|
@ -110,8 +110,7 @@ BEFORE_WORKLOAD_EXECUTION = Signal('before-workload-execution', invert_priority=
|
|||||||
SUCCESSFUL_WORKLOAD_EXECUTION = Signal('successful-workload-execution')
|
SUCCESSFUL_WORKLOAD_EXECUTION = Signal('successful-workload-execution')
|
||||||
AFTER_WORKLOAD_EXECUTION = Signal('after-workload-execution')
|
AFTER_WORKLOAD_EXECUTION = Signal('after-workload-execution')
|
||||||
|
|
||||||
BEFORE_WORKLOAD_RESULT_EXTRACTION = Signal('before-workload-result-extracton',
|
BEFORE_WORKLOAD_RESULT_EXTRACTION = Signal('before-workload-result-extracton', invert_priority=True)
|
||||||
invert_priority=True)
|
|
||||||
SUCCESSFUL_WORKLOAD_RESULT_EXTRACTION = Signal('successful-workload-result-extracton')
|
SUCCESSFUL_WORKLOAD_RESULT_EXTRACTION = Signal('successful-workload-result-extracton')
|
||||||
AFTER_WORKLOAD_RESULT_EXTRACTION = Signal('after-workload-result-extracton')
|
AFTER_WORKLOAD_RESULT_EXTRACTION = Signal('after-workload-result-extracton')
|
||||||
|
|
||||||
@ -183,8 +182,6 @@ AFTER_RUN_OUTPUT_PROCESSED = Signal(
|
|||||||
'after-run-output-processed')
|
'after-run-output-processed')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
CallbackPriority = enum(['extremely_low', 'very_low', 'low', 'normal',
|
CallbackPriority = enum(['extremely_low', 'very_low', 'low', 'normal',
|
||||||
'high', 'very_high', 'extremely_high'], -30, 10)
|
'high', 'very_high', 'extremely_high'], -30, 10)
|
||||||
|
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
|
|
||||||
from copy import copy
|
from copy import copy
|
||||||
|
|
||||||
#Not going to be used for now.
|
|
||||||
|
|
||||||
class TargetConfig(dict):
|
class TargetConfig(dict):
|
||||||
"""
|
"""
|
||||||
|
@ -289,51 +289,62 @@ GEM5_PLATFORM_PARAMS = [
|
|||||||
|
|
||||||
CONNECTION_PARAMS = {
|
CONNECTION_PARAMS = {
|
||||||
AdbConnection: [
|
AdbConnection: [
|
||||||
Parameter('device', kind=str,
|
Parameter(
|
||||||
|
'device', kind=str,
|
||||||
aliases=['adb_name'],
|
aliases=['adb_name'],
|
||||||
description="""
|
description="""
|
||||||
ADB device name
|
ADB device name
|
||||||
"""),
|
"""),
|
||||||
Parameter('adb_server', kind=str,
|
Parameter(
|
||||||
|
'adb_server', kind=str,
|
||||||
description="""
|
description="""
|
||||||
ADB server to connect to.
|
ADB server to connect to.
|
||||||
"""),
|
"""),
|
||||||
],
|
],
|
||||||
SshConnection: [
|
SshConnection: [
|
||||||
Parameter('host', kind=str, mandatory=True,
|
Parameter(
|
||||||
|
'host', kind=str, mandatory=True,
|
||||||
description="""
|
description="""
|
||||||
Host name or IP address of the target.
|
Host name or IP address of the target.
|
||||||
"""),
|
"""),
|
||||||
Parameter('username', kind=str, mandatory=True,
|
Parameter(
|
||||||
|
'username', kind=str, mandatory=True,
|
||||||
description="""
|
description="""
|
||||||
User name to connect with
|
User name to connect with
|
||||||
"""),
|
"""),
|
||||||
Parameter('password', kind=str,
|
Parameter(
|
||||||
|
'password', kind=str,
|
||||||
description="""
|
description="""
|
||||||
Password to use.
|
Password to use.
|
||||||
"""),
|
"""),
|
||||||
Parameter('keyfile', kind=str,
|
Parameter(
|
||||||
|
'keyfile', kind=str,
|
||||||
description="""
|
description="""
|
||||||
Key file to use
|
Key file to use
|
||||||
"""),
|
"""),
|
||||||
Parameter('port', kind=int,
|
Parameter(
|
||||||
|
'port', kind=int,
|
||||||
description="""
|
description="""
|
||||||
The port SSH server is listening on on the target.
|
The port SSH server is listening on on the target.
|
||||||
"""),
|
"""),
|
||||||
Parameter('telnet', kind=bool, default=False,
|
Parameter(
|
||||||
|
'telnet', kind=bool, default=False,
|
||||||
description="""
|
description="""
|
||||||
If set to ``True``, a Telnet connection, rather than
|
If set to ``True``, a Telnet connection, rather than
|
||||||
SSH will be used.
|
SSH will be used.
|
||||||
"""),
|
"""),
|
||||||
Parameter('password_prompt', kind=str,
|
Parameter(
|
||||||
|
'password_prompt', kind=str,
|
||||||
description="""
|
description="""
|
||||||
Password prompt to expect
|
Password prompt to expect
|
||||||
"""),
|
"""),
|
||||||
Parameter('original_prompt', kind=str,
|
Parameter(
|
||||||
|
'original_prompt', kind=str,
|
||||||
description="""
|
description="""
|
||||||
Original shell prompt to expect.
|
Original shell prompt to expect.
|
||||||
"""),
|
"""),
|
||||||
Parameter('sudo_cmd', kind=str,
|
Parameter(
|
||||||
|
'sudo_cmd', kind=str,
|
||||||
default="sudo -- sh -c '{}'",
|
default="sudo -- sh -c '{}'",
|
||||||
description="""
|
description="""
|
||||||
Sudo command to use. Must have ``"{}"`` specified
|
Sudo command to use. Must have ``"{}"`` specified
|
||||||
@ -342,44 +353,53 @@ CONNECTION_PARAMS = {
|
|||||||
"""),
|
"""),
|
||||||
],
|
],
|
||||||
Gem5Connection: [
|
Gem5Connection: [
|
||||||
Parameter('host', kind=str, mandatory=False,
|
Parameter(
|
||||||
|
'host', kind=str, mandatory=False,
|
||||||
description="""
|
description="""
|
||||||
Host name or IP address of the target.
|
Host name or IP address of the target.
|
||||||
"""),
|
"""),
|
||||||
Parameter('username', kind=str, default='root',
|
Parameter(
|
||||||
|
'username', kind=str, default='root',
|
||||||
description="""
|
description="""
|
||||||
User name to connect to gem5 simulation.
|
User name to connect to gem5 simulation.
|
||||||
"""),
|
"""),
|
||||||
Parameter('password', kind=str,
|
Parameter(
|
||||||
|
'password', kind=str,
|
||||||
description="""
|
description="""
|
||||||
Password to use.
|
Password to use.
|
||||||
"""),
|
"""),
|
||||||
Parameter('port', kind=int,
|
Parameter(
|
||||||
|
'port', kind=int,
|
||||||
description="""
|
description="""
|
||||||
The port SSH server is listening on on the target.
|
The port SSH server is listening on on the target.
|
||||||
"""),
|
"""),
|
||||||
Parameter('password_prompt', kind=str,
|
Parameter(
|
||||||
|
'password_prompt', kind=str,
|
||||||
description="""
|
description="""
|
||||||
Password prompt to expect
|
Password prompt to expect
|
||||||
"""),
|
"""),
|
||||||
Parameter('original_prompt', kind=str,
|
Parameter(
|
||||||
|
'original_prompt', kind=str,
|
||||||
description="""
|
description="""
|
||||||
Original shell prompt to expect.
|
Original shell prompt to expect.
|
||||||
"""),
|
"""),
|
||||||
],
|
],
|
||||||
LocalConnection: [
|
LocalConnection: [
|
||||||
Parameter('password', kind=str,
|
Parameter(
|
||||||
|
'password', kind=str,
|
||||||
description="""
|
description="""
|
||||||
Password to use for sudo. if not specified, the user will
|
Password to use for sudo. if not specified, the user will
|
||||||
be prompted during intialization.
|
be prompted during intialization.
|
||||||
"""),
|
"""),
|
||||||
Parameter('keep_password', kind=bool, default=True,
|
Parameter(
|
||||||
|
'keep_password', kind=bool, default=True,
|
||||||
description="""
|
description="""
|
||||||
If ``True`` (the default), the password will be cached in
|
If ``True`` (the default), the password will be cached in
|
||||||
memory after it is first obtained from the user, so that the
|
memory after it is first obtained from the user, so that the
|
||||||
user would not be prompted for it again.
|
user would not be prompted for it again.
|
||||||
"""),
|
"""),
|
||||||
Parameter('unrooted', kind=bool, default=False,
|
Parameter(
|
||||||
|
'unrooted', kind=bool, default=False,
|
||||||
description="""
|
description="""
|
||||||
Indicate that the target should be considered unrooted; do not
|
Indicate that the target should be considered unrooted; do not
|
||||||
attempt sudo or ask the user for their password.
|
attempt sudo or ask the user for their password.
|
||||||
@ -524,7 +544,6 @@ class DefaultTargetDescriptor(TargetDescriptor):
|
|||||||
return cls, updated_params
|
return cls, updated_params
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
_adhoc_target_descriptions = []
|
_adhoc_target_descriptions = []
|
||||||
|
|
||||||
|
|
||||||
|
@ -53,7 +53,6 @@ class TargetManager(object):
|
|||||||
self.parameters = parameters
|
self.parameters = parameters
|
||||||
self.disconnect = parameters.get('disconnect')
|
self.disconnect = parameters.get('disconnect')
|
||||||
|
|
||||||
|
|
||||||
def initialize(self):
|
def initialize(self):
|
||||||
self._init_target()
|
self._init_target()
|
||||||
|
|
||||||
|
@ -132,8 +132,7 @@ class HotplugRuntimeConfig(RuntimeConfig):
|
|||||||
param_name = 'num_cores'
|
param_name = 'num_cores'
|
||||||
self._runtime_params[param_name] = \
|
self._runtime_params[param_name] = \
|
||||||
RuntimeParameter(param_name, kind=int,
|
RuntimeParameter(param_name, kind=int,
|
||||||
constraint=lambda x:
|
constraint=lambda x: 0 <= x <= self.target.number_of_cpus,
|
||||||
0 <= x <= self.target.number_of_cpus,
|
|
||||||
description="""
|
description="""
|
||||||
The number of cpu cores to be online
|
The number of cpu cores to be online
|
||||||
""",
|
""",
|
||||||
@ -144,8 +143,7 @@ class HotplugRuntimeConfig(RuntimeConfig):
|
|||||||
param_name = 'num_{}_cores'.format(name)
|
param_name = 'num_{}_cores'.format(name)
|
||||||
self._runtime_params[param_name] = \
|
self._runtime_params[param_name] = \
|
||||||
RuntimeParameter(param_name, kind=int,
|
RuntimeParameter(param_name, kind=int,
|
||||||
constraint=lambda x, name=name:
|
constraint=lambda x, name=name: 0 <= x <= len(self.target.core_cpus(name)),
|
||||||
0 <= x <= len(self.target.core_cpus(name)),
|
|
||||||
description="""
|
description="""
|
||||||
The number of {} cores to be online
|
The number of {} cores to be online
|
||||||
""".format(name),
|
""".format(name),
|
||||||
@ -167,8 +165,7 @@ class HotplugRuntimeConfig(RuntimeConfig):
|
|||||||
param_name = 'num_{}_cores'.format(cluster)
|
param_name = 'num_{}_cores'.format(cluster)
|
||||||
self._runtime_params[param_name] = \
|
self._runtime_params[param_name] = \
|
||||||
RuntimeParameter(param_name, kind=int,
|
RuntimeParameter(param_name, kind=int,
|
||||||
constraint=lambda x, cluster=cluster:
|
constraint=lambda x, c=cluster: 0 <= x <= len(resolve_cpus(c, self.target)),
|
||||||
0 <= x <= len(resolve_cpus(cluster, self.target)),
|
|
||||||
description="""
|
description="""
|
||||||
The number of cores on the {} cluster to be online
|
The number of cores on the {} cluster to be online
|
||||||
""".format(cluster),
|
""".format(cluster),
|
||||||
@ -334,7 +331,8 @@ class CpufreqRuntimeConfig(RuntimeConfig):
|
|||||||
freq_val = FreqValue(common_freqs)
|
freq_val = FreqValue(common_freqs)
|
||||||
param_name = 'frequency'
|
param_name = 'frequency'
|
||||||
self._runtime_params[param_name] = \
|
self._runtime_params[param_name] = \
|
||||||
RuntimeParameter(param_name, kind=freq_val,
|
RuntimeParameter(
|
||||||
|
param_name, kind=freq_val,
|
||||||
setter=self.set_frequency,
|
setter=self.set_frequency,
|
||||||
setter_params={'core': None},
|
setter_params={'core': None},
|
||||||
description="""
|
description="""
|
||||||
@ -342,7 +340,8 @@ class CpufreqRuntimeConfig(RuntimeConfig):
|
|||||||
""")
|
""")
|
||||||
param_name = 'max_frequency'
|
param_name = 'max_frequency'
|
||||||
self._runtime_params[param_name] = \
|
self._runtime_params[param_name] = \
|
||||||
RuntimeParameter(param_name, kind=freq_val,
|
RuntimeParameter(
|
||||||
|
param_name, kind=freq_val,
|
||||||
setter=self.set_max_frequency,
|
setter=self.set_max_frequency,
|
||||||
setter_params={'core': None},
|
setter_params={'core': None},
|
||||||
description="""
|
description="""
|
||||||
@ -350,7 +349,8 @@ class CpufreqRuntimeConfig(RuntimeConfig):
|
|||||||
""")
|
""")
|
||||||
param_name = 'min_frequency'
|
param_name = 'min_frequency'
|
||||||
self._runtime_params[param_name] = \
|
self._runtime_params[param_name] = \
|
||||||
RuntimeParameter(param_name, kind=freq_val,
|
RuntimeParameter(
|
||||||
|
param_name, kind=freq_val,
|
||||||
setter=self.set_min_frequency,
|
setter=self.set_min_frequency,
|
||||||
setter_params={'core': None},
|
setter_params={'core': None},
|
||||||
description="""
|
description="""
|
||||||
@ -360,7 +360,8 @@ class CpufreqRuntimeConfig(RuntimeConfig):
|
|||||||
if common_gov:
|
if common_gov:
|
||||||
param_name = 'governor'
|
param_name = 'governor'
|
||||||
self._runtime_params[param_name] = \
|
self._runtime_params[param_name] = \
|
||||||
RuntimeParameter(param_name, kind=str,
|
RuntimeParameter(
|
||||||
|
param_name, kind=str,
|
||||||
allowed_values=common_gov,
|
allowed_values=common_gov,
|
||||||
setter=self.set_governor,
|
setter=self.set_governor,
|
||||||
setter_params={'core': None},
|
setter_params={'core': None},
|
||||||
@ -370,7 +371,8 @@ class CpufreqRuntimeConfig(RuntimeConfig):
|
|||||||
|
|
||||||
param_name = 'governor_tunables'
|
param_name = 'governor_tunables'
|
||||||
self._runtime_params[param_name] = \
|
self._runtime_params[param_name] = \
|
||||||
RuntimeParameter(param_name, kind=dict,
|
RuntimeParameter(
|
||||||
|
param_name, kind=dict,
|
||||||
merge=True,
|
merge=True,
|
||||||
setter=self.set_governor_tunables,
|
setter=self.set_governor_tunables,
|
||||||
setter_params={'core': None},
|
setter_params={'core': None},
|
||||||
@ -386,7 +388,8 @@ class CpufreqRuntimeConfig(RuntimeConfig):
|
|||||||
|
|
||||||
param_name = '{}_frequency'.format(name)
|
param_name = '{}_frequency'.format(name)
|
||||||
self._runtime_params[param_name] = \
|
self._runtime_params[param_name] = \
|
||||||
RuntimeParameter(param_name, kind=freq_val,
|
RuntimeParameter(
|
||||||
|
param_name, kind=freq_val,
|
||||||
setter=self.set_frequency,
|
setter=self.set_frequency,
|
||||||
setter_params={'core': name},
|
setter_params={'core': name},
|
||||||
description="""
|
description="""
|
||||||
@ -394,7 +397,8 @@ class CpufreqRuntimeConfig(RuntimeConfig):
|
|||||||
""".format(name))
|
""".format(name))
|
||||||
param_name = '{}_max_frequency'.format(name)
|
param_name = '{}_max_frequency'.format(name)
|
||||||
self._runtime_params[param_name] = \
|
self._runtime_params[param_name] = \
|
||||||
RuntimeParameter(param_name, kind=freq_val,
|
RuntimeParameter(
|
||||||
|
param_name, kind=freq_val,
|
||||||
setter=self.set_max_frequency,
|
setter=self.set_max_frequency,
|
||||||
setter_params={'core': name},
|
setter_params={'core': name},
|
||||||
description="""
|
description="""
|
||||||
@ -402,7 +406,8 @@ class CpufreqRuntimeConfig(RuntimeConfig):
|
|||||||
""".format(name))
|
""".format(name))
|
||||||
param_name = '{}_min_frequency'.format(name)
|
param_name = '{}_min_frequency'.format(name)
|
||||||
self._runtime_params[param_name] = \
|
self._runtime_params[param_name] = \
|
||||||
RuntimeParameter(param_name, kind=freq_val,
|
RuntimeParameter(
|
||||||
|
param_name, kind=freq_val,
|
||||||
setter=self.set_min_frequency,
|
setter=self.set_min_frequency,
|
||||||
setter_params={'core': name},
|
setter_params={'core': name},
|
||||||
description="""
|
description="""
|
||||||
@ -410,7 +415,8 @@ class CpufreqRuntimeConfig(RuntimeConfig):
|
|||||||
""".format(name))
|
""".format(name))
|
||||||
param_name = '{}_governor'.format(name)
|
param_name = '{}_governor'.format(name)
|
||||||
self._runtime_params[param_name] = \
|
self._runtime_params[param_name] = \
|
||||||
RuntimeParameter(param_name, kind=str,
|
RuntimeParameter(
|
||||||
|
param_name, kind=str,
|
||||||
allowed_values=avail_govs,
|
allowed_values=avail_govs,
|
||||||
setter=self.set_governor,
|
setter=self.set_governor,
|
||||||
setter_params={'core': name},
|
setter_params={'core': name},
|
||||||
@ -419,7 +425,8 @@ class CpufreqRuntimeConfig(RuntimeConfig):
|
|||||||
""".format(name))
|
""".format(name))
|
||||||
param_name = '{}_gov_tunables'.format(name)
|
param_name = '{}_gov_tunables'.format(name)
|
||||||
self._runtime_params[param_name] = \
|
self._runtime_params[param_name] = \
|
||||||
RuntimeParameter(param_name, kind=dict,
|
RuntimeParameter(
|
||||||
|
param_name, kind=dict,
|
||||||
setter=self.set_governor_tunables,
|
setter=self.set_governor_tunables,
|
||||||
setter_params={'core': name},
|
setter_params={'core': name},
|
||||||
merge=True,
|
merge=True,
|
||||||
@ -434,7 +441,8 @@ class CpufreqRuntimeConfig(RuntimeConfig):
|
|||||||
|
|
||||||
param_name = 'cpu{}_frequency'.format(cpu_no)
|
param_name = 'cpu{}_frequency'.format(cpu_no)
|
||||||
self._runtime_params[param_name] = \
|
self._runtime_params[param_name] = \
|
||||||
RuntimeParameter(param_name, kind=freq_val,
|
RuntimeParameter(
|
||||||
|
param_name, kind=freq_val,
|
||||||
setter=self.set_frequency,
|
setter=self.set_frequency,
|
||||||
setter_params={'core': cpu_no},
|
setter_params={'core': cpu_no},
|
||||||
description="""
|
description="""
|
||||||
@ -442,7 +450,8 @@ class CpufreqRuntimeConfig(RuntimeConfig):
|
|||||||
""".format(cpu_no))
|
""".format(cpu_no))
|
||||||
param_name = 'cpu{}_max_frequency'.format(cpu_no)
|
param_name = 'cpu{}_max_frequency'.format(cpu_no)
|
||||||
self._runtime_params[param_name] = \
|
self._runtime_params[param_name] = \
|
||||||
RuntimeParameter(param_name, kind=freq_val,
|
RuntimeParameter(
|
||||||
|
param_name, kind=freq_val,
|
||||||
setter=self.set_max_frequency,
|
setter=self.set_max_frequency,
|
||||||
setter_params={'core': cpu_no},
|
setter_params={'core': cpu_no},
|
||||||
description="""
|
description="""
|
||||||
@ -450,7 +459,8 @@ class CpufreqRuntimeConfig(RuntimeConfig):
|
|||||||
""".format(cpu_no))
|
""".format(cpu_no))
|
||||||
param_name = 'cpu{}_min_frequency'.format(cpu_no)
|
param_name = 'cpu{}_min_frequency'.format(cpu_no)
|
||||||
self._runtime_params[param_name] = \
|
self._runtime_params[param_name] = \
|
||||||
RuntimeParameter(param_name, kind=freq_val,
|
RuntimeParameter(
|
||||||
|
param_name, kind=freq_val,
|
||||||
setter=self.set_min_frequency,
|
setter=self.set_min_frequency,
|
||||||
setter_params={'core': cpu_no},
|
setter_params={'core': cpu_no},
|
||||||
description="""
|
description="""
|
||||||
@ -458,7 +468,8 @@ class CpufreqRuntimeConfig(RuntimeConfig):
|
|||||||
""".format(cpu_no))
|
""".format(cpu_no))
|
||||||
param_name = 'cpu{}_governor'.format(cpu_no)
|
param_name = 'cpu{}_governor'.format(cpu_no)
|
||||||
self._runtime_params[param_name] = \
|
self._runtime_params[param_name] = \
|
||||||
RuntimeParameter(param_name, kind=str,
|
RuntimeParameter(
|
||||||
|
param_name, kind=str,
|
||||||
allowed_values=avail_govs,
|
allowed_values=avail_govs,
|
||||||
setter=self.set_governor,
|
setter=self.set_governor,
|
||||||
setter_params={'core': cpu_no},
|
setter_params={'core': cpu_no},
|
||||||
@ -467,7 +478,8 @@ class CpufreqRuntimeConfig(RuntimeConfig):
|
|||||||
""".format(cpu_no))
|
""".format(cpu_no))
|
||||||
param_name = 'cpu{}_gov_tunables'.format(cpu_no)
|
param_name = 'cpu{}_gov_tunables'.format(cpu_no)
|
||||||
self._runtime_params[param_name] = \
|
self._runtime_params[param_name] = \
|
||||||
RuntimeParameter(param_name, kind=dict,
|
RuntimeParameter(
|
||||||
|
param_name, kind=dict,
|
||||||
setter=self.set_governor_tunables,
|
setter=self.set_governor_tunables,
|
||||||
setter_params={'core': cpu_no},
|
setter_params={'core': cpu_no},
|
||||||
merge=True,
|
merge=True,
|
||||||
@ -484,7 +496,8 @@ class CpufreqRuntimeConfig(RuntimeConfig):
|
|||||||
param_name = '{}_frequency'.format(cluster)
|
param_name = '{}_frequency'.format(cluster)
|
||||||
|
|
||||||
self._runtime_params[param_name] = \
|
self._runtime_params[param_name] = \
|
||||||
RuntimeParameter(param_name, kind=freq_val,
|
RuntimeParameter(
|
||||||
|
param_name, kind=freq_val,
|
||||||
setter=self.set_frequency,
|
setter=self.set_frequency,
|
||||||
setter_params={'core': cluster},
|
setter_params={'core': cluster},
|
||||||
description="""
|
description="""
|
||||||
@ -492,7 +505,8 @@ class CpufreqRuntimeConfig(RuntimeConfig):
|
|||||||
""".format(cluster))
|
""".format(cluster))
|
||||||
param_name = '{}_max_frequency'.format(cluster)
|
param_name = '{}_max_frequency'.format(cluster)
|
||||||
self._runtime_params[param_name] = \
|
self._runtime_params[param_name] = \
|
||||||
RuntimeParameter(param_name, kind=freq_val,
|
RuntimeParameter(
|
||||||
|
param_name, kind=freq_val,
|
||||||
setter=self.set_max_frequency,
|
setter=self.set_max_frequency,
|
||||||
setter_params={'core': cluster},
|
setter_params={'core': cluster},
|
||||||
description="""
|
description="""
|
||||||
@ -500,7 +514,8 @@ class CpufreqRuntimeConfig(RuntimeConfig):
|
|||||||
""".format(cluster))
|
""".format(cluster))
|
||||||
param_name = '{}_min_frequency'.format(cluster)
|
param_name = '{}_min_frequency'.format(cluster)
|
||||||
self._runtime_params[param_name] = \
|
self._runtime_params[param_name] = \
|
||||||
RuntimeParameter(param_name, kind=freq_val,
|
RuntimeParameter(
|
||||||
|
param_name, kind=freq_val,
|
||||||
setter=self.set_min_frequency,
|
setter=self.set_min_frequency,
|
||||||
setter_params={'core': cluster},
|
setter_params={'core': cluster},
|
||||||
description="""
|
description="""
|
||||||
@ -508,7 +523,8 @@ class CpufreqRuntimeConfig(RuntimeConfig):
|
|||||||
""".format(cluster))
|
""".format(cluster))
|
||||||
param_name = '{}_governor'.format(cluster)
|
param_name = '{}_governor'.format(cluster)
|
||||||
self._runtime_params[param_name] = \
|
self._runtime_params[param_name] = \
|
||||||
RuntimeParameter(param_name, kind=str,
|
RuntimeParameter(
|
||||||
|
param_name, kind=str,
|
||||||
allowed_values=avail_govs,
|
allowed_values=avail_govs,
|
||||||
setter=self.set_governor,
|
setter=self.set_governor,
|
||||||
setter_params={'core': cluster},
|
setter_params={'core': cluster},
|
||||||
@ -517,7 +533,8 @@ class CpufreqRuntimeConfig(RuntimeConfig):
|
|||||||
""".format(cluster))
|
""".format(cluster))
|
||||||
param_name = '{}_gov_tunables'.format(cluster)
|
param_name = '{}_gov_tunables'.format(cluster)
|
||||||
self._runtime_params[param_name] = \
|
self._runtime_params[param_name] = \
|
||||||
RuntimeParameter(param_name, kind=dict,
|
RuntimeParameter(
|
||||||
|
param_name, kind=dict,
|
||||||
setter=self.set_governor_tunables,
|
setter=self.set_governor_tunables,
|
||||||
setter_params={'core': cluster},
|
setter_params={'core': cluster},
|
||||||
merge=True,
|
merge=True,
|
||||||
@ -679,6 +696,7 @@ class CpufreqRuntimeConfig(RuntimeConfig):
|
|||||||
|
|
||||||
return all_freqs, common_freqs, common_gov
|
return all_freqs, common_freqs, common_gov
|
||||||
|
|
||||||
|
|
||||||
class IdleStateValue(object):
|
class IdleStateValue(object):
|
||||||
|
|
||||||
def __init__(self, values):
|
def __init__(self, values):
|
||||||
@ -750,7 +768,8 @@ class CpuidleRuntimeConfig(RuntimeConfig):
|
|||||||
if common_idle_states:
|
if common_idle_states:
|
||||||
param_name = 'idle_states'
|
param_name = 'idle_states'
|
||||||
self._runtime_params[param_name] = \
|
self._runtime_params[param_name] = \
|
||||||
RuntimeParameter(param_name, kind=idle_state_val,
|
RuntimeParameter(
|
||||||
|
param_name, kind=idle_state_val,
|
||||||
setter=self.set_idle_state,
|
setter=self.set_idle_state,
|
||||||
setter_params={'core': None},
|
setter_params={'core': None},
|
||||||
description="""
|
description="""
|
||||||
@ -762,7 +781,8 @@ class CpuidleRuntimeConfig(RuntimeConfig):
|
|||||||
idle_state_val = IdleStateValue(self.supported_idle_states.get(cpu))
|
idle_state_val = IdleStateValue(self.supported_idle_states.get(cpu))
|
||||||
param_name = '{}_idle_states'.format(name)
|
param_name = '{}_idle_states'.format(name)
|
||||||
self._runtime_params[param_name] = \
|
self._runtime_params[param_name] = \
|
||||||
RuntimeParameter(param_name, kind=idle_state_val,
|
RuntimeParameter(
|
||||||
|
param_name, kind=idle_state_val,
|
||||||
setter=self.set_idle_state,
|
setter=self.set_idle_state,
|
||||||
setter_params={'core': name},
|
setter_params={'core': name},
|
||||||
description="""
|
description="""
|
||||||
@ -773,7 +793,8 @@ class CpuidleRuntimeConfig(RuntimeConfig):
|
|||||||
idle_state_val = IdleStateValue(self.supported_idle_states.get(cpu_no))
|
idle_state_val = IdleStateValue(self.supported_idle_states.get(cpu_no))
|
||||||
param_name = 'cpu{}_idle_states'.format(cpu_no)
|
param_name = 'cpu{}_idle_states'.format(cpu_no)
|
||||||
self._runtime_params[param_name] = \
|
self._runtime_params[param_name] = \
|
||||||
RuntimeParameter(param_name, kind=idle_state_val,
|
RuntimeParameter(
|
||||||
|
param_name, kind=idle_state_val,
|
||||||
setter=self.set_idle_state,
|
setter=self.set_idle_state,
|
||||||
setter_params={'core': cpu_no},
|
setter_params={'core': cpu_no},
|
||||||
description="""
|
description="""
|
||||||
@ -786,7 +807,8 @@ class CpuidleRuntimeConfig(RuntimeConfig):
|
|||||||
idle_state_val = IdleStateValue(self.supported_idle_states.get(cpu))
|
idle_state_val = IdleStateValue(self.supported_idle_states.get(cpu))
|
||||||
param_name = '{}_idle_states'.format(cluster)
|
param_name = '{}_idle_states'.format(cluster)
|
||||||
self._runtime_params[param_name] = \
|
self._runtime_params[param_name] = \
|
||||||
RuntimeParameter(param_name, kind=idle_state_val,
|
RuntimeParameter(
|
||||||
|
param_name, kind=idle_state_val,
|
||||||
setter=self.set_idle_state,
|
setter=self.set_idle_state,
|
||||||
setter_params={'core': cluster},
|
setter_params={'core': cluster},
|
||||||
description="""
|
description="""
|
||||||
@ -826,6 +848,7 @@ class CpuidleRuntimeConfig(RuntimeConfig):
|
|||||||
common_idle_states.append(state)
|
common_idle_states.append(state)
|
||||||
return common_idle_states
|
return common_idle_states
|
||||||
|
|
||||||
|
|
||||||
ScreenOrientation = enum(['NATURAL', 'LEFT', 'INVERTED', 'RIGHT'])
|
ScreenOrientation = enum(['NATURAL', 'LEFT', 'INVERTED', 'RIGHT'])
|
||||||
|
|
||||||
|
|
||||||
@ -865,7 +888,8 @@ class AndroidRuntimeConfig(RuntimeConfig):
|
|||||||
|
|
||||||
param_name = 'brightness'
|
param_name = 'brightness'
|
||||||
self._runtime_params[param_name] = \
|
self._runtime_params[param_name] = \
|
||||||
RuntimeParameter(param_name, kind=int,
|
RuntimeParameter(
|
||||||
|
param_name, kind=int,
|
||||||
constraint=lambda x: 0 <= x <= 255,
|
constraint=lambda x: 0 <= x <= 255,
|
||||||
default=127,
|
default=127,
|
||||||
setter=self.set_brightness,
|
setter=self.set_brightness,
|
||||||
@ -877,7 +901,8 @@ class AndroidRuntimeConfig(RuntimeConfig):
|
|||||||
if self.target.os == 'android':
|
if self.target.os == 'android':
|
||||||
param_name = 'airplane_mode'
|
param_name = 'airplane_mode'
|
||||||
self._runtime_params[param_name] = \
|
self._runtime_params[param_name] = \
|
||||||
RuntimeParameter(param_name, kind=bool,
|
RuntimeParameter(
|
||||||
|
param_name, kind=bool,
|
||||||
setter=self.set_airplane_mode,
|
setter=self.set_airplane_mode,
|
||||||
description="""
|
description="""
|
||||||
Specify whether airplane mode should be
|
Specify whether airplane mode should be
|
||||||
@ -886,7 +911,8 @@ class AndroidRuntimeConfig(RuntimeConfig):
|
|||||||
|
|
||||||
param_name = 'rotation'
|
param_name = 'rotation'
|
||||||
self._runtime_params[param_name] = \
|
self._runtime_params[param_name] = \
|
||||||
RuntimeParameter(param_name, kind=ScreenOrientation,
|
RuntimeParameter(
|
||||||
|
param_name, kind=ScreenOrientation,
|
||||||
setter=self.set_rotation,
|
setter=self.set_rotation,
|
||||||
description="""
|
description="""
|
||||||
Specify the screen orientation for the device
|
Specify the screen orientation for the device
|
||||||
@ -894,7 +920,8 @@ class AndroidRuntimeConfig(RuntimeConfig):
|
|||||||
|
|
||||||
param_name = 'screen_on'
|
param_name = 'screen_on'
|
||||||
self._runtime_params[param_name] = \
|
self._runtime_params[param_name] = \
|
||||||
RuntimeParameter(param_name, kind=bool,
|
RuntimeParameter(
|
||||||
|
param_name, kind=bool,
|
||||||
default=True,
|
default=True,
|
||||||
setter=self.set_screen_state,
|
setter=self.set_screen_state,
|
||||||
description="""
|
description="""
|
||||||
|
@ -114,7 +114,6 @@ class Workload(TargetedPlugin):
|
|||||||
'Workload "{}" requires internet. Target does not appear '
|
'Workload "{}" requires internet. Target does not appear '
|
||||||
'to be connected to the internet.'.format(self.name))
|
'to be connected to the internet.'.format(self.name))
|
||||||
|
|
||||||
|
|
||||||
def run(self, context):
|
def run(self, context):
|
||||||
"""
|
"""
|
||||||
Execute the workload. This is the method that performs the actual
|
Execute the workload. This is the method that performs the actual
|
||||||
@ -288,7 +287,6 @@ class ApkWorkload(Workload):
|
|||||||
super(ApkWorkload, self).teardown(context)
|
super(ApkWorkload, self).teardown(context)
|
||||||
self.apk.teardown()
|
self.apk.teardown()
|
||||||
|
|
||||||
|
|
||||||
def deploy_assets(self, context):
|
def deploy_assets(self, context):
|
||||||
super(ApkWorkload, self).deploy_assets(context)
|
super(ApkWorkload, self).deploy_assets(context)
|
||||||
self.target.refresh_files(self.deployed_assets)
|
self.target.refresh_files(self.deployed_assets)
|
||||||
@ -373,6 +371,7 @@ class ApkReventWorkload(ApkUIWorkload):
|
|||||||
self.extract_results_timeout,
|
self.extract_results_timeout,
|
||||||
self.teardown_timeout)
|
self.teardown_timeout)
|
||||||
|
|
||||||
|
|
||||||
class UIWorkload(Workload):
|
class UIWorkload(Workload):
|
||||||
|
|
||||||
def __init__(self, target, **kwargs):
|
def __init__(self, target, **kwargs):
|
||||||
@ -459,7 +458,6 @@ class ReventWorkload(UIWorkload):
|
|||||||
self.teardown_timeout)
|
self.teardown_timeout)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class UiAutomatorGUI(object):
|
class UiAutomatorGUI(object):
|
||||||
|
|
||||||
stages = ['setup', 'runWorkload', 'extractResults', 'teardown']
|
stages = ['setup', 'runWorkload', 'extractResults', 'teardown']
|
||||||
|
Loading…
x
Reference in New Issue
Block a user