History log of /external/autotest/client/site_tests/firmware_TouchMTB/tests/common_unittest_utils.py
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
60a345dd2a6a7c27407153b6c9734d2b63a88c01 28-Jul-2014 Joseph Hwang <josephsih@chromium.org> firmware_TouchMTB: add MtbSanityValidator

This patch checks two things.

1. Ghost fingers:
The validator checks if there exist ghost fingers before fingers
touch the touch device. This is accomplished by querying the
InputDevice class which syncs with the kernel evdev driver about
the mt slots information.

2. MTB event rules:
The MTB events emitted by a device have to follow some rules.
Otherwise, the events may confuse the state machine in the MTB
parser. As a beginning, this validator checks some simple rules:

a. No TRACKING ID is set to -1 before a slot is assigned a
positive TRACKING ID value.

b. No X, Y, or PRESSURE values could be assigned to a slot
before the slot is assigned a positive TRACKING ID value.

More rules may be added to this validator when needed.

Note that item 1 above is to detect any pre-existing fingers
before the test is conducted, while item 2 is to detect any event
mis-ordering or corruption occurring during the test.

BUG=chrome-os-partner:30965
TEST=All unit tests should pass on a chromebook.
$ cd /usr/local/autotest/tests/firmware_TouchMTB
$ python tests/run_all_unittests.py

Change-Id: Id85dcb8e54601f5dfd6d77bbf3802fdcb2d74a60
Reviewed-on: https://chromium-review.googlesource.com/210792
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/tests/common_unittest_utils.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/tests/common_unittest_utils.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/tests/common_unittest_utils.py
f16a39fd38ddaec0707d9ea3b1f7c3a2a0bb090f 21-Jun-2013 Joseph Hwang <josephsih@chromium.org> firmware_TouchMTB: add metrics for Stationary Finger Validator

In this patch, we add the metric for StationaryFingerValidator:
- the maximum distance between any two points of the stationary finger in mm

The result logs are updated due to the change of the validator and
its criteria. Some unit tests are also added/updated accordingly.

BUG=chromium:252669
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 the metrics would look like:
ReportRateValidator
fw_11.23: {
'max_distance_mm': (1.3453, 1.3453, 1.3453)
}
fw_11.27: {
'max_distance_mm': (1.7159, 1.7159, 1.7159)}
}

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

Change-Id: Ia010ba136434348762ba2ae3351e5ac929dc28ec
Reviewed-on: https://gerrit.chromium.org/gerrit/59723
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/tests/common_unittest_utils.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/tests/common_unittest_utils.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/tests/common_unittest_utils.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/tests/common_unittest_utils.py