summaryrefslogtreecommitdiff
path: root/cts/cts.py
Commit message (Collapse)AuthorAgeFilesLines
* Unify #! use in python scriptsStefan Reinauer2020-08-111-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Right now we have several different versions of #! in our python scripts. Unify them all and specify that we are using python2. Signed-off-by: Stefan Reinauer <reinauer@chromium.org> BUG=none BRANCH=none TEST=make buildall Change-Id: Iab33a3f5d4b827451a55542bcee8837b00da7867 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1817948 Commit-Queue: Stefan Reinauer <reinauer@chromium.org> Tested-by: Stefan Reinauer <reinauer@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> (cherry picked from commit 68c9a2870ead8a3306a2601c4f5689656d49c6a8) Change-Id: I55272c289eaeb24bbaa7024ece7beb4cb14ea9ec Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2314108 Tested-by: Mary Ruthven <mruthven@chromium.org> Reviewed-by: Mary Ruthven <mruthven@chromium.org> Commit-Queue: Mary Ruthven <mruthven@chromium.org> (cherry picked from commit a72597d3bfaed8a602e9db138da23d5fdb7f5e56) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2350270
* eCTS: Add nested interrupt test (High->Low)Daisuke Nojiri2016-11-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | Add a nested interrupt test to eCTS. Higher priority IRQ is fired, followed by lower priority IRQ. Handlers should be executed sequentially. P1 *-----* / \ P2 / *-----* / \ task_cts ----* *---- B C A D BUG=chromium:653195 BRANCH=none TEST=cts.py -m interrupt; make buildall Change-Id: Ia9f1bf4205cefe8bdc11cc0aa3ad2057359b73ef Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/409611 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* eCTS: Pause a few seconds before flushing ttyDaisuke Nojiri2016-11-091-14/+15
| | | | | | | | | | | | | | | | After a board is reset for setting up a tty port, the host should wait for a few seconds before flushing the port as the board may still be booting. This should prevent output from the previous boot from creeping into a test run. BUG=none BRANCH=none TEST=cts.py -m gpio, interrupt, timer Change-Id: I1fb567a3a8ddcfff61865b6db3866c56be386c4a Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/408759 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* cts: Fix back-to-back buildDaisuke Nojiri2016-10-141-2/+7
| | | | | | | | | | | | | | | | | | | Currently eCTS suites share the same directory (e.g. build/stm32l476g -eval) to put build artifacts even though some files (e.g. board.c) compile differently suite to suite. So, if cts-i2c-stm32l476g-eval is built, followed by cts-gpio-stm32l476g-eval, build fails or produces incorrect binary. This patch makes eCTS create different directories for each suite. As a bonus, we can now builds eCTS suites in parallel. BUG=chromium:654549 BRANCH=none TEST=make buildall -j (with uncommitted change) Change-Id: I4abedc917787be5f79b97e0e50d0d08e01bd5f9d Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/398281
* cts: Fix error message for uart port being occupiedDaisuke Nojiri2016-10-051-3/+3
| | | | | | | | | | | | | This patch fixes the error messages displayed when a UART port connected to DUT or TH is being occupied. BUG=none BRANCH=none TEST=run cts.py -m i2c Change-Id: I3fbb4068e8ee3af7a1b04f70ae70b3d870a19d2e Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/393327
* cts: Fail script when build or flash failsDaisuke Nojiri2016-10-051-4/+8
| | | | | | | | | | | | | | This change makes cts.py fail when building or flashing a module for DUT or TH fails. BUG=none BRANCH=none TEST=Made cts.py fail by injecting build and flash error Change-Id: Iec1e11f4a8c261eb4c989b118df218e86cb6f5f1 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/393326 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* cts: Refactor cts.pyDaisuke Nojiri2016-09-131-431/+114
| | | | | | | | | | | | | | | | | | | | Noteworthy changes: - Move Board and its child classes in common/board.py - Separate flashing and resetting. Flashing used to imply running tests. - Move up constants up for better visibility - Change default suite to 'meta' - Removed redundant code - Lots of renames (all lower case names, shorter names, etc.) BUG=none BRANCH=none TEST=Ran meta test and verify the results match the expectations Change-Id: I158d96e2ee104767d25b2e721d5206e528600381 Reviewed-on: https://chromium-review.googlesource.com/383911 Commit-Ready: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* cts: Fixed bug with conflicting error codesChris Chen2016-08-101-0/+2
| | | | | | | | | | | | | BRANCH=None BUG=None TEST=Manual - Build and run meta tests, look for listed output Change-Id: Idd46fb92791c1d0576be95f3e4cda8cdca66daef Reviewed-on: https://chromium-review.googlesource.com/367401 Commit-Ready: Chris Chen <twothreecc@google.com> Tested-by: Chris Chen <twothreecc@google.com> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* cts: Debug message support added to cts testsChris Chen2016-08-101-30/+114
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | You can now add debug messages into a cts test and they will be displayed with the test report html page. The macro to use is CTS_DEBUG_PRINTF Adding debug messages can potentially change test results by slowing down the test, so you can choose when compiling a test suite if you want the debug messages present or not by adding --debug as an argument when you call ./cts --build. BRANCH=None BUG=None TEST=Manual - Add a debug statement to a test - Build the test suite with --debug specified - Flash the boards - Run './cts/cts.py -r' - Open /tmp/cts_results/<board_name>/<test_suite>.html to view see your debug message for the test Change-Id: Icad8e0ac5cc905010caa4e7616f81572ce6ac771 Reviewed-on: https://chromium-review.googlesource.com/362475 Commit-Ready: Chris Chen <twothreecc@google.com> Tested-by: Chris Chen <twothreecc@google.com> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* cts: Added corruption detectionChris Chen2016-08-091-13/+20
| | | | | | | | | | | | | | | | | | | | | | | If test suite doesn't finish or results are received out of order, this is likely an indication of reset or hang by one of the boards and all tests after the point of corruption are marked as corrupted. BRANCH=None BUG=None TEST=Manual - Edit the gpio th code to change ordering of tests or hang or reset, etc. - Build and flash tests - Run './cts/cts.py -r' - You should see the results for all of the tests, with all corrupted tests marked as corrupted Change-Id: I7925e37db285a4e90e6e09bf3b187400ddfe9edf Reviewed-on: https://chromium-review.googlesource.com/362614 Commit-Ready: Chris Chen <twothreecc@google.com> Tested-by: Chris Chen <twothreecc@google.com> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* cts: Added html output to ctsChris Chen2016-08-081-2/+39
| | | | | | | | | | | | | | | | | | | | When you run a test suite, cts will now save your results for the suite/dut combo as a basic html page BRANCH=None BUG=None TEST=Manual - Connect dut, th - Build/flash desired test suite - Run './cts -r' to run tests - Open /tmp/cts_results/<board_name>/<test_suite>.html - You should see a table with test names/results Change-Id: Id3de3bd7833be1bc5dde437c516db411aac47579 Reviewed-on: https://chromium-review.googlesource.com/362091 Commit-Ready: Chris Chen <twothreecc@google.com> Tested-by: Chris Chen <twothreecc@google.com> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* cts: Refactored scriptChris Chen2016-08-081-296/+398
| | | | | | | | | | | | | | | | | | | | Added in classes for Board (parent), DeviceUnderTest, and TestHarness. Reading, etc. should be easier now BRANCH=None BUG=None TEST=Manual - Build default - Flash default - Run - Open /tmp/cts_results/nucleo-f072rb/gpio.html - Should see a clean results page Change-Id: Ide3f75281f0b5b8b40dabd36f8c239737dc527d6 Reviewed-on: https://chromium-review.googlesource.com/364236 Commit-Ready: Chris Chen <twothreecc@google.com> Tested-by: Chris Chen <twothreecc@google.com> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* cts: Added parsing for cts suitesChris Chen2016-07-261-135/+446
| | | | | | | | | | | | | | | | | | | | | | Added test recording when calling reset from command line. These results are printed on the screen and saved in /tmp/results/<board>/<module>.txt BRANCH=None BUG=None TEST=Manual - Connect, build and flash boards - Navigate to ec/cts - ./cts.py --run - Find test results /tmp/results/<board>/<module>.txt - Tests names should be left aligned in one column and their results right aligned in a 2nd column Change-Id: I3429d6092f2bd5d5f6825245f5439ace3f47f1fa Reviewed-on: https://chromium-review.googlesource.com/360653 Commit-Ready: Chris Chen <twothreecc@google.com> Tested-by: Chris Chen <twothreecc@google.com> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* cts: Added GPIO test suiteChris Chen2016-07-151-6/+4
| | | | | | | | | | | | | | | | | | | | | | | Contains code for all the gpio tests so far. Code in cts_task for th and dut is for testing purposes and test result reporting will be updated in the next patch. BRANCH=None BUG=None TEST=Manual - Connect handshake and gpio test lines between th and dut - Build tests - run 'cat /dev/ttyACM0' in one terminal - run 'cat /def/ttyACM1' in another - Flash boards - All test results should print either passed or unknown Change-Id: I7142fb87a6ce0a20c571cde608fbbe60e35898ea Reviewed-on: https://chromium-review.googlesource.com/359935 Commit-Ready: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* cts: First patch flashes blank testsChris Chen2016-07-091-0/+178
The first time you use this with a particular th, connect only th and run ./cts.py --th Then connect both boards and you can run ./cts.py to build/flash both boards. BRANCH=None BUG=None TEST=manual - Enter chroot - Navigate to ec/cts - Connect only th - 'sudo ./cts.py --th' - './cts.py -b' - Exit chroot - Connect both boards - './cts.py -f' Each board should flash successfully Change-Id: Ib14fccabcd9fdad04f9b92817da597bc0dcb3d89 Reviewed-on: https://chromium-review.googlesource.com/358100 Commit-Ready: Chris Chen <twothreecc@google.com> Tested-by: Chris Chen <twothreecc@google.com> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>