Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(123)

Unified Diff: client/site_tests/hardware_tsl2563/hardware_tsl2563.py

Issue 3064043: Update the tsl2563 test. (Closed) Base URL: ssh://git@chromiumos-git/autotest.git
Patch Set: Changes per testing and review. Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « client/site_tests/hardware_tsl2563/control ('k') | client/site_tests/hardware_tsl2563/src/Makefile » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/site_tests/hardware_tsl2563/hardware_tsl2563.py
diff --git a/client/site_tests/hardware_tsl2563/hardware_tsl2563.py b/client/site_tests/hardware_tsl2563/hardware_tsl2563.py
index c712d7e64f38a510fdcdd44f93f84cdf791cadc2..e1d5adc700ffb513a4cee3b7f723cb42688b67ab 100644
--- a/client/site_tests/hardware_tsl2563/hardware_tsl2563.py
+++ b/client/site_tests/hardware_tsl2563/hardware_tsl2563.py
@@ -2,28 +2,30 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-import os
-
+import logging, os
from autotest_lib.client.bin import test, utils
from autotest_lib.client.common_lib import error
+
class hardware_tsl2563(test.test):
"""
Test the TSL2560/1/2/3 Light Sensor device.
Failure to find the device likely indicates the kernel module is not loaded.
- Or it could mean an i2c_adapter was not found for it. To spoof one:
- echo tsl2563 0x29 > /sys/class/i2c-adapter/i2c-0/new_device
- This will also automatically load the module.
+ Or it could mean the I2C probe for the device failed because of an incorrect
+ I2C address or bus specification.
+ The upscript /etc/init/powerd.conf should properly load the driver so that
+ we can find its files in /sys/class/iio/device0/.
"""
version = 1
- preserve_srcdir = True
-
- def setup(self):
- os.chdir(self.srcdir)
- utils.system('make')
-
-
def run_once(self):
- tsl_test_cmd = os.path.join(self.srcdir, "tsl2563tst")
- utils.system(tsl_test_cmd)
+ try:
+ lux_out = utils.read_one_line('/sys/class/iio/device0/lux')
+ except:
+ raise error.TestFail('The tsl2563 driver is not '
+ 'exporting its lux file')
+ lux = int(lux_out)
+ if lux < 0:
bfreed 2010/08/06 18:03:01 Testing shows I can get values over 64K. In looki
+ raise error.TestFail('Invalid tsl2563 lux string (%s)' % lux_out)
+ logging.debug("tsl2563 lux value is %d", lux)
+
« no previous file with comments | « client/site_tests/hardware_tsl2563/control ('k') | client/site_tests/hardware_tsl2563/src/Makefile » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698