touch_firmware_test: enable ChromeOS webplot for Python 3.x

Some modules were already adapted for Python 3.x, this converts the
rest of the modules needed for 'webplot' tool functionality on ChromeOS.
Not intended to break Python 2.x operation.

 * General 2/3 compatible pythonic language changes (print, range, dict,
   except, map & bytestrings)
 * Adjust wrapper script to ensure webplot runs under python3, as we do
   not keep ws4py around for python2.

Also (unclear if this is related to python 3):
 * Fix apparently incidental bug of reading ev data: description
   ends after a blank line, not a 2-second timeout.

BUG=chromium:1095095
TEST=webplot validated manually, and test_that --board=hatch ${DUT}
     platform_GesturesRegressionTestValidated passed; both on hatch.

Cq-Depend: chromium:2441402
Change-Id: Ie6887bf913c76d9a53a215b98bc56c0b1ce053fb
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/touch_firmware_test/+/2437494
Reviewed-by: Harry Cutts <hcutts@chromium.org>
Reviewed-by: Sean O'Brien <seobrien@chromium.org>
Tested-by: Kenneth Albanowski <kenalba@google.com>
Commit-Queue: Kenneth Albanowski <kenalba@google.com>
9 files changed
tree: b3a2dd4696a6c467f437404bda96614588669343
  1. heatmap/
  2. remote/
  3. report/
  4. tests/
  5. touchbot/
  6. webplot/
  7. .gitignore
  8. Dockerfile
  9. gesture_interpreter.py
  10. main.py
  11. OWNERS
  12. quickstep_gesture.py
  13. README.md
  14. requirements.txt
  15. run_container.sh
  16. setup.py
  17. test_suite.py
  18. train_fingertip_pos.py
  19. webplot_chromeos_touchpad.sh
  20. webplot_chromeos_touchscreen.sh
README.md

Touch Firmware Test

This repo holds the source code of the touch firmware test.

Get the source:

$ git clone https://chromium.googlesource.com/chromiumos/platform/touch_firmware_test

Run the code:

See this website for details: https://www.chromium.org/for-testers/touch-firmware-tests .

Run in Docker:

You can also run the tests in docker now. You can build your own docker image or use the one on docker hub.

How to run tests in docker

  • Connect the test device.
  • Stop the host machine adb: $ adb kill-server
  • Start docker image: $ docker run -t -i --privileged -v /dev/bus/usb:/dev/bus/usb -v $(pwd -L):/output -p 8080:8080 wjkcow/cros_touch_test bash The test report will be saved into current directory. You can change “$(pwd -L)” to any directory you want.
  • Start adb server in the container by $ adb start-server Note: The first run might fail, try it again, it should work.
  • Run the test. For android, do “python main.py -t android”.
  • Follow the instructions in terminal, go to http://127.0.0.1:8080. If you don't open the webpage, the test might stuck.