1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-01-19 12:24:32 +00:00

Merge pull request #177 from ep1cman/release-notes

servo_power: Added check for device platform.
This commit is contained in:
setrofim 2016-06-08 11:16:14 +01:00
commit 59d74b6273
2 changed files with 6 additions and 2 deletions

View File

@ -9,7 +9,7 @@ from itertools import izip_longest
from wlauto import Instrument, Parameter from wlauto import Instrument, Parameter
from wlauto import ApkFile from wlauto import ApkFile
from wlauto.exceptions import DeviceError, HostError from wlauto.exceptions import InstrumentError, HostError
from wlauto.utils.android import ApkInfo from wlauto.utils.android import ApkInfo
from wlauto.utils.types import list_of_strings from wlauto.utils.types import list_of_strings
@ -160,7 +160,7 @@ class NetstatsInstrument(Instrument):
def initialize(self, context): def initialize(self, context):
if self.device.platform != 'android': if self.device.platform != 'android':
raise DeviceError('nestats instrument only supports on Android devices.') raise InstrumentError('nestats instrument is only supported on Android devices.')
apk = context.resolver.get(ApkFile(self)) apk = context.resolver.get(ApkFile(self))
self.collector = NetstatsCollector(self.device, apk) # pylint: disable=attribute-defined-outside-init self.collector = NetstatsCollector(self.device, apk) # pylint: disable=attribute-defined-outside-init
self.collector.setup(force=self.force_reinstall) self.collector.setup(force=self.force_reinstall)

View File

@ -117,6 +117,10 @@ class ServoPowerMonitor(Instrument):
self.poller = None self.poller = None
self.data = None self.data = None
self.stopped = True self.stopped = True
if self.device.platform != "chromeos":
raise InstrumentError("servo_power instrument only supports Chrome OS devices.")
if not self.labels: if not self.labels:
self.labels = ["PORT_{}".format(channel) for channel, _ in enumerate(self.power_domains)] self.labels = ["PORT_{}".format(channel) for channel, _ in enumerate(self.power_domains)]