From 982069be320b1fe1b16d5e87b0e959ff81aae6d9 Mon Sep 17 00:00:00 2001 From: Sebastian Goscik Date: Wed, 8 Jun 2016 10:57:22 +0100 Subject: [PATCH 1/2] servo_power: Added check for device platform. Now checks to see if the device is running chromeOS. --- wlauto/instrumentation/servo_power_monitors/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wlauto/instrumentation/servo_power_monitors/__init__.py b/wlauto/instrumentation/servo_power_monitors/__init__.py index 4cf94861..49e09b53 100644 --- a/wlauto/instrumentation/servo_power_monitors/__init__.py +++ b/wlauto/instrumentation/servo_power_monitors/__init__.py @@ -117,6 +117,10 @@ class ServoPowerMonitor(Instrument): self.poller = None self.data = None self.stopped = True + + if self.device.platform != "chromeos": + raise InstrumentError("servo_power instrument only supports Chrome OS devices.") + if not self.labels: self.labels = ["PORT_{}".format(channel) for channel, _ in enumerate(self.power_domains)] From 7b92f355c898bcb772351b8d81d5e4634d92314c Mon Sep 17 00:00:00 2001 From: Sebastian Goscik Date: Wed, 8 Jun 2016 11:13:35 +0100 Subject: [PATCH 2/2] netstat: Changed exception type & typo fix --- wlauto/instrumentation/netstats/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wlauto/instrumentation/netstats/__init__.py b/wlauto/instrumentation/netstats/__init__.py index 48967101..78de2e92 100644 --- a/wlauto/instrumentation/netstats/__init__.py +++ b/wlauto/instrumentation/netstats/__init__.py @@ -9,7 +9,7 @@ from itertools import izip_longest from wlauto import Instrument, Parameter 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.types import list_of_strings @@ -160,7 +160,7 @@ class NetstatsInstrument(Instrument): def initialize(self, context): 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)) self.collector = NetstatsCollector(self.device, apk) # pylint: disable=attribute-defined-outside-init self.collector.setup(force=self.force_reinstall)