History log of /external/autotest/client/site_tests/firmware_TouchMTB/touch_device.py
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
9bf35806c29274084b9b73e216beb7e358ac861b 15-Aug-2014 Joseph Hwang <josephsih@chromium.org> firmware_TouchMTB: fix a bug when touch_device is None

It is handy to be able to conduct unittests in chroot especially
when a chromebook is not in hand. This patch fixed a bug caused
by the fact that there might be no touch device on a desktop host.

BUG=chrome-os-partner:30965
TEST=None. Unittests should all pass when executed in chroot.
(cr) $ cd .../autotest/files/client/site_tests/firmware_TouchMTB
(cr) $ python tests/run_all_unittests.py

Change-Id: Ie8a0db3857fc94e7ace7cec489d85257a3467197
Reviewed-on: https://chromium-review.googlesource.com/212851
Reviewed-by: Charles Mooney <charliemooney@chromium.org>
Tested-by: Charles Mooney <charliemooney@chromium.org>
Commit-Queue: Shyh-In Hwang <josephsih@chromium.org>
/external/autotest/client/site_tests/firmware_TouchMTB/touch_device.py
3648a2d533dce9d9cbe96847560e66ac5a9e9b89 06-Jun-2014 Joseph Hwang <josephsih@chromium.org> firmware_TouchMTB: probe device node for touch devices

The touch firmware test suite encountered an error in probing
the touchscreen device node. The root cause is that the script
/opt/google/touchscreen/tscontrol used to probe the device node
was removed recently. Hence, this patch utilizes the more basic
xinput.sh script to probe the device node.

BUG=chromium:381580
TEST=Conduct touchscreen fw test on a chromebook.
$ cd /usr/local/autotest/tests/firmware_TouchMTB/
$ DISPLAY=:0 python main.py -m complete --touchscreen

or conduct touchpad fw test on a chromebook.
$ DISPLAY=:0 python main.py -m complete

Both tests should execute correctly without incurring errors.

Change-Id: I512d81b682ce39f861224dbbf034757ac0b65745
Reviewed-on: https://chromium-review.googlesource.com/202873
Reviewed-by: Charles Mooney <charliemooney@chromium.org>
Commit-Queue: Shyh-In Hwang <josephsih@chromium.org>
Tested-by: Shyh-In Hwang <josephsih@chromium.org>
/external/autotest/client/site_tests/firmware_TouchMTB/touch_device.py
ec84f267cd18c3571e5b094428397fd0567979a2 28-Aug-2013 Joseph Hwang <josephsih@chromium.org> firmware_TouchMTB: replay with a touch input device and capture images

It would be handy if we could replay a raw data file into a touch
input device node and capture its mtplot image for examination.

It requires the following steps:
1. Convert the raw data file in mtplot format to evemu format.
2. Launch mtplot.
3. Use evemu-play to replay the raw data file in evemu format.
4. Dump the screenshot of mtplot and save it in an image file.

For more details about the raw data format, the mtplot format
looks like:

Event: time 171466.621737, type 3 (EV_ABS), code 0 (ABS_X), value 1272

while its corresponding evemu format looks like

E: 171466.621737 0003 0000 1272

The mtplot format is more human readable, while only the
evemu format is supported by evemu-play to replay the raw
data into the touch device node.

BUG=chromium:282029
TEST=Follow the steps below on a Link:
$ cd /usr/local/autotest/tests/firmware_TouchMTB

Replay an existing raw data file using touchpad device node:
$ python tools/mtplot_play.py tests/logs/link/20130806_221321-fw_1.0.AA-robot/one_finger_tracking.left_to_right.normal-link-fw_1.0.AA-robot-20130806_221509.dat

Replay an existing raw data file using touchscreen device node:
(This is only possible on Link which has the touchscreen.)
$ python tools/mtplot_play.py -d touchscreen tests/logs/link/20130806_221321-fw_1.0.AA-robot/one_finger_tracking.left_to_right.normal-link-fw_1.0.AA-robot-20130806_221509.dat

Observe that it launches mtplot, replays the raw data file, the
cursor moves automatically on the mtplot. After the replay is
finished, it prompts that the corresponding evemu data file and
the image file are saved.

Change-Id: Ia291e0dadf05736db64ee1d6a667ff075db9a21c
Reviewed-on: https://chromium-review.googlesource.com/167603
Reviewed-by: Charles Mooney <charliemooney@chromium.org>
Tested-by: Shyh-In Hwang <josephsih@chromium.org>
Commit-Queue: Shyh-In Hwang <josephsih@chromium.org>
/external/autotest/client/site_tests/firmware_TouchMTB/touch_device.py
2f764a11ced016b65348284950be7442bbfca2c6 26-Aug-2013 Joseph Hwang <josephsih@chromium.org> firmware_TouchMTB: save the device description file

In order to be able to replay with an existing device description
file in the test log directory, we need to save the device
description file in the test log directory in the first place.

BUG=chromium:274204
TEST=conduct the touch firmware test on a chromebook say link.
Launch the test suite. Press 'x' to exit after having recorded
a few gestures.
$ /usr/local/autotest/tests/firmware_TouchMTB
$ DISPLAY=:0 python main.py -m manual

Check the existence of "link.touchpad"
$ cat cat /var/tmp/touch_firmware_test/latest/link.touchpad

It will print something like:
N: link-touch-device
I: 0018 0000 0000 0000
P: 05 00 00 00 00 00 00 00
B: 00 0b 00 00 00 00 00 00 00
B: 01 00 00 00 00 00 00 00 00
...
A: 00 0 2040 0 0 20
A: 01 0 1360 0 0 20
A: 18 0 255 0 0 0
A: 2f 0 9 0 0 0
A: 30 0 1878 0 0 0
A: 35 0 2040 0 0 20
A: 36 0 1360 0 0 20
A: 39 0 65535 0 0 0
A: 3a 0 255 0 0 0

Also make sure that all unit tests pass.
$ python tests/run_all_unittests.py

Change-Id: I21218841250a150131e71df205c968d0e45f4c40
Reviewed-on: https://chromium-review.googlesource.com/66929
Reviewed-by: Charles Mooney <charliemooney@chromium.org>
Commit-Queue: Shyh-In Hwang <josephsih@chromium.org>
Tested-by: Shyh-In Hwang <josephsih@chromium.org>
/external/autotest/client/site_tests/firmware_TouchMTB/touch_device.py
ad3136c03a931b4c1742cdec472780be15f7e1ed 12-Aug-2013 Joseph Hwang <josephsih@chromium.org> firmware_TouchMTB: replay with a mocked device

It is handy and sometimes essential to be able to replay the test
logs captured from a platform on another platform.

When replaying logs, the board on which the logs were captured could
be different from the board of the chromebook currently used. Hence,
the correct board should be extracted from the log specified in the
replay directory. The following priority is used to find the device
description file used to mock the particular touch device for that
board:
(1) use the device description file in the replay directory
(2) use the device description file found in tests/device directory

However, if "-d/--system_device" command line option is specified, use
the system touch device found on the chromebook instead as before.

BUG=chromium:274204
TEST=Replay the lumpy logs on both lumpy and link. Observe that
their summary reports are exactly the same.
$ cd /usr/local/autotest/tests/firmware_TouchMTB
$ tools/machine_replay.sh -b tests/logs/lumpy -s
$ ./summary.sh -d /tmp -m f

Change-Id: I95a39d0ead821de9379e2f3a26f19e42a9c829b9
Reviewed-on: https://gerrit.chromium.org/gerrit/66345
Reviewed-by: Charlie Mooney <charliemooney@chromium.org>
Tested-by: Joseph Shyh-In Hwang <josephsih@chromium.org>
Commit-Queue: Joseph Shyh-In Hwang <josephsih@chromium.org>
/external/autotest/client/site_tests/firmware_TouchMTB/touch_device.py
eb2c422de0873a741d68699d9f91d1ad351b9add 07-Aug-2013 Joseph Hwang <josephsih@chromium.org> firmware_TouchMTB: adjustment of linearity validator

We need to do some adjustment for the linearity validator according
to the x-t and the y-t figure in the attached png file in
chromium:248210 #6 which is a left-to-right one-finger-tracking
gesture performed by the robot.

Adjustment as follows:
(1) Calculate the regression line based on only the middle segment.
(2) Calculate the metrics of max errors and rms erros only on the
middle segment. The begin segment and the end segment may only
represent a pause.
(3) Pick up only certain axis(es) when calculating the statistics
of metrics:
horizontal lines: metrics only in the x axis
vertical lines: metrics only in the y axis
diagonal lines: metrics both in the x and y axes

BUG=chromium:248120
TEST=Run the unit tests on a chromebook or in chroot
(cr) $ cd .../firmware_TouchMTB
(cr) $ python tests/run_all_unittests.py
Observe that all unit tests should pass.

Change-Id: I28566662831aae50be3274bd9b23e870506ba160
Reviewed-on: https://gerrit.chromium.org/gerrit/66344
Reviewed-by: Charlie Mooney <charliemooney@chromium.org>
Tested-by: Joseph Shyh-In Hwang <josephsih@chromium.org>
Commit-Queue: Joseph Shyh-In Hwang <josephsih@chromium.org>
/external/autotest/client/site_tests/firmware_TouchMTB/touch_device.py
1dfb83324d02b4f82a8ee2bd32525e78197adf86 31-Jul-2013 Joseph Hwang <josephsih@chromium.org> firmware_TouchMTB: reverse coordinates for touchscreen in robot mode

When performing the touchscreen tests using the robot, the device is
placed upside down and is rotated 180 degrees. We need to reverse the
coordinates to make correct gestures.

BUG=chromium:266720
TEST=conduct the touchscreen firmware tests with the touch robot.
$ cd /usr/local/autotest/tests/firmware_TouchMTB
Conduct the touchscreen tests with 1 iteration using the robot.
$ DISPLAY=:0 python main.py -m robot -i 1 --touchscreen
Observe that the robot performs the gestures correctly with respect
to the touchscreen's orientation.

Change-Id: Ic01f2612942585bb1f72da42ff986b8adb50306d
Reviewed-on: https://gerrit.chromium.org/gerrit/64180
Reviewed-by: Joseph Shyh-In Hwang <josephsih@chromium.org>
Tested-by: Joseph Shyh-In Hwang <josephsih@chromium.org>
Commit-Queue: Joseph Shyh-In Hwang <josephsih@chromium.org>
/external/autotest/client/site_tests/firmware_TouchMTB/touch_device.py
51b95395336cc1e887d17acab137fcd450b7bfdc 18-Jun-2013 Joseph Hwang <josephsih@chromium.org> firmware_TouchMTB: metrics for RangeValidator

In this patch, we add the number of mm that cannot be reached
for each of the four edges.

BUG=chromium:251604
TEST=Replay logs on a lumpy.
$ cd /usr/local/autotest/tests/firmware_TouchMTB
$ tools/machine_replay.sh -b tests/logs/lumpy/ -s
And then run the summary script to generate a summary report.
$ ./summary.sh -d /tmp -m

Observe its metrics would be like:
RangeValidator
fw_11.23: {'short_of_range_left_mm': (0.083, 0.083, 0.083)}
fw_11.27: {'short_of_range_left_mm': (0.0, 0.0, 0.0)}

All of the unit tests should pass.
$ python tests/run_all_unittests.py

Change-Id: I315faa1eb72d84ee522f56ae13334a559b8b4ff8
Reviewed-on: https://gerrit.chromium.org/gerrit/59217
Commit-Queue: Joseph Shyh-In Hwang <josephsih@chromium.org>
Reviewed-by: Joseph Shyh-In Hwang <josephsih@chromium.org>
Tested-by: Joseph Shyh-In Hwang <josephsih@chromium.org>
/external/autotest/client/site_tests/firmware_TouchMTB/touch_device.py
10016f7a7ffb74c3c03ac548575ac74bd1a9a222 04-Jun-2013 Joseph Hwang <josephsih@chromium.org> firmware_TouchMTB: add the linearity validator v2

In this patch, we design the linearity validator v2 by finding the
line of best fit for y vs. time and x vs. time using simple linear
regression. Then find the max errors for both, and find the average
squared errors for both.

BUG=chromium:248120
TEST=Replay logs on a lumpy.

$ cd /usr/local/autotest/tests/firmware_TouchMTB
$ tools/machine_replay.sh -b tests/logs/lumpy/ -s

In the test results, observe that the max error (i.e., max_err) and
root mean square (i.e., rms_err or the average squared error) of
linearity validator are shown like

Linearity(Middle)Validator
max_err: (2.19, 1.44) mm
rms_err: (1.31, 0.80) mm
criteria_str: <= 0.8, ~ +2.4
score: 0.375691

Also make sure that the unit tests should all pass.
$ python tests/run_all_unittests.py

Change-Id: I73935fc24faa430cfce0420e386807841e6d0a91
Reviewed-on: https://gerrit.chromium.org/gerrit/58084
Reviewed-by: Charlie Mooney <charliemooney@chromium.org>
Tested-by: Joseph Shyh-In Hwang <josephsih@chromium.org>
Commit-Queue: Joseph Shyh-In Hwang <josephsih@chromium.org>
/external/autotest/client/site_tests/firmware_TouchMTB/touch_device.py
3f245993196c7cead8716ff09633a6ad49e8b006 15-May-2013 Joseph Hwang <josephsih@chromium.org> firmware_TouchMTB: New drumroll validator

The new drumroll validator requires that all points from the same
finger should be within 2 circles of radius X mm (e.g., 2 mm).
Pass if so. Fail if all points cannot be covered by 2 circles of
radius X mm.

In order to run unit tests with a mocked device, we also allow to
create such a mocked device by passing the device description into
TouchDevice class.

BUG=chromium:241092
TEST=On a chromebook
$ cd /usr/local/autotest/tests/firmware_TouchMTB
Make sure that the following unit test pass.
$ python tests/validators_unittest.py

Change-Id: I439fc70fc8c2b1d47b3475b7013997768c326feb
Reviewed-on: https://gerrit.chromium.org/gerrit/55758
Reviewed-by: Joseph Shyh-In Hwang <josephsih@chromium.org>
Tested-by: Joseph Shyh-In Hwang <josephsih@chromium.org>
Commit-Queue: Joseph Shyh-In Hwang <josephsih@chromium.org>
/external/autotest/client/site_tests/firmware_TouchMTB/touch_device.py
8c5e275df682ef5b0ad52574ae1e2e31fc724509 22-Apr-2013 Joseph Hwang <josephsih@chromium.org> firmware_TouchMTB: Rename the test suite and fix the programs

To finish renaming the test suite, we also need to fix the prompts,
classes, methods, variables, and strings, etc. to reduce confusion.

BUG=chromium:234117
TEST=Install the test suite to a chromebook
(cr) $ ./run_remote_tests.sh --autotest_dir
~/trunk/src/third_party/autotest/files --remote=$MACHINE_IP
firmware_TouchMTB
On the chromebook, conduct the test suite as follows.
$ DISPLAY=:0 python main.py
It should execute normally.

Change-Id: Iaf5d5060bf68e3e0a13913a69227636fba2fbeb6
Reviewed-on: https://gerrit.chromium.org/gerrit/48782
Reviewed-by: Charlie Mooney <charliemooney@chromium.org>
Commit-Queue: Joseph Shyh-In Hwang <josephsih@chromium.org>
Tested-by: Joseph Shyh-In Hwang <josephsih@chromium.org>
/external/autotest/client/site_tests/firmware_TouchMTB/touch_device.py
0cbff8bf3666a81b886080f82712943e36dad95f 22-Apr-2013 Joseph Hwang <josephsih@chromium.org> firmware_TouchMTB: Rename the test suite as firmware_TouchMTB

As the test suite is now applicable to both the touchpad
and the touchscreen, it is proper to rename the test name
from firmware_TouchpadMTB to firmware_TouchMTB.

BUG=chromium:234117
TEST=None. Will be combined with next patch.

Change-Id: I92ecc074023c76f7c2f292b7e22ef960d537819f
Reviewed-on: https://gerrit.chromium.org/gerrit/48781
Reviewed-by: Charlie Mooney <charliemooney@chromium.org>
Commit-Queue: Joseph Shyh-In Hwang <josephsih@chromium.org>
Tested-by: Joseph Shyh-In Hwang <josephsih@chromium.org>
/external/autotest/client/site_tests/firmware_TouchMTB/touch_device.py