summaryrefslogtreecommitdiff
path: root/cts/gpio
Commit message (Collapse)AuthorAgeFilesLines
* eCTS: Print start marker before syncDaisuke Nojiri2017-06-273-40/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch makes each test print start marker before sync. This will allow us to distinguish the failure before even sync is attempted (CTS_RC_DID_NOT_START, thus probably caused by the previous test) and the failure caused by the hanging partner, in which case the one good and alive will be stuck in sync (and should return _DID_NOT_END or even better _BAD_SYNC once we implement timeout in sync). This patch also: * Adds did_not_start_test to and removes debug_test from meta suite * Consolidates test runner loops into common cts_main_loop * Removes dut_common.h and th_common.h * Removes debug print macro and CTS_DEBUG * Replaces all infinite loops after tests with task_wait_event(-1) * Removes meaningless comments and debug printfs * Removes CTS_TEST_ID_* * Adds sync() to task suite BUG=chromium:736104 BRANCH=none TEST=Run run_ects.sh and verify all tests pass Change-Id: I6ccdf26afac6b8e8cb16483c5d75e4e77e7962f4 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/545176
* eCTS: Check order and expectation of test resultsDaisuke Nojiri2017-06-233-8/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch makes the framework verify not only the result but also the execution order of the tests. It also allows each test to specify expected return code and strings printed by TH and DUT. The final test results depends on the return code and the expectation. Therefore, the output now includes 'RESULT' column showing PASS or FAIL: test name TH_RETURN_CODE DUT_RETURN_CODE TH_STR DUT_STR RESULT test_task_switch SUCCESS SUCCESS 1 1 PASS test_task_priority SUCCESS FAILURE 1 1 FAIL test_stack_overflow DID_NOT_END DID_NOT_END 1 1 PASS Additionally, this patch: * Adds CTS_RC_DID_NOT_START and CTS_RC_DID_NOT_END to indicate whether the test did start or end, respectively. * Makes stack overflow test check whether stack overflow was detected and reboot occurred * Removes post_corruption_test and conflict test since now the test results are stricly compared against expected results. * Fixes gpylint errors. BUG=none BRANCH=none TEST=Run gpio, meta, timer, interrupt, and cts/cts.py -m task Change-Id: I3b7005236e705dcac0c8f4711b44c85ff9a4f676 Reviewed-on: https://chromium-review.googlesource.com/538878 Commit-Ready: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* cts: Added corruption detectionChris Chen2016-08-091-0/+2
| | | | | | | | | | | | | | | | | | | | | | | 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 parsing for cts suitesChris Chen2016-07-262-5/+7
| | | | | | | | | | | | | | | | | | | | | | 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 file to list error codes as integersChris Chen2016-07-212-77/+37
| | | | | | | | | | | | | | | | | | | | 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 print their test name followed by a space and and integer error code Change-Id: If52e9b50705779b3a291e2d0f6b0721a5b6197d8 Reviewed-on: https://chromium-review.googlesource.com/359988 Commit-Ready: Chris Chen <twothreecc@google.com> Tested-by: Chris Chen <twothreecc@google.com> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* cts: Disambiguate enum cts_error_codeDaisuke Nojiri2016-07-152-25/+25
| | | | | | | | | | | BUG=none BRANCH=none TEST=make -j buildall Change-Id: I8008fcf8ea5a429ec6c3bd2cc59fe86f43d87ada Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/360180 Reviewed-by: Chris Chen <twothreecc@google.com>
* cts: Use pointers for test functionsDaisuke Nojiri2016-07-154-65/+46
| | | | | | | | | | | | | | | | Test functions are listed in cts.testlist and shared by th.c and dut.c. This way, we can gurantee the two files are in sync. Also, cts.testlist is used to count the number of tests automatically. This allows us to use a for loop to execute each test. BUG=none BRANCH=none TEST=build buildall Change-Id: I0c811405134fad04f5c6914b1ac38835e212cbd2 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/359619
* cts: Added GPIO test suiteChris Chen2016-07-153-2/+215
| | | | | | | | | | | | | | | | | | | | | | | 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: Added sync() functionChris Chen2016-07-122-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | sync() involves 2 gpios on each board, each labeled GPIO_HANDSHAKE_OUTPUT and GPIO_HANDSHAKE_INPUT on their respective boards. They both start low, then the th wiggles his line up and down, waiting for the dut to mimic it. BRANCH=None BUG=None TEST=manual - Connect handshake lines to appropriate pins on each board (pins found in board's gpio.inc) - Build tests - Flash boards - run 'cat /dev/ttyACM0' in one terminal - run 'cat /dev/ttyACM1' in another - They should each have printed 'successful sync' Change-Id: I61233bca9605ba89c3628c2a65ca9013c56365ea Reviewed-on: https://chromium-review.googlesource.com/359355 Commit-Ready: Chris Chen <twothreecc@google.com> Tested-by: Chris Chen <twothreecc@google.com> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* cts: First patch flashes blank testsChris Chen2016-07-092-0/+30
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>