Commit Graph

84 Commits (a6b78c6429993c7bb06152e37125050f162b3b6d)

Author SHA1 Message Date
Martin Kojtal 9cb8a12cc2 fix SPDX identifier typos 2020-02-21 07:01:55 +00:00
Martin Kojtal e20e7b8066 tests: fix SPDX identifiers 2020-02-21 07:01:01 +00:00
Filip Jagodzinski 0b8baa568d Tests: ResetReason: Use the get_capabilities()
Make use of the new hal_reset_reason_get_capabilities() function to skip
unsupported reset resaons during tests.
2020-01-03 12:11:45 +01:00
Hugues Kamba 7b845409a0 UnbufferedSerial: Introduce the class to replace RawSerial
* Deprecate RawSerial.
* Introduce UnbufferedSerial to provide unbuffered I/O by implementing
  with a FileHandle interface for I/O	streams.
* Add Greentea test for the UnbufferedSerial class.
2019-12-12 08:44:09 +00:00
Veijo Pesonen 060a1c6df7 NVStore: deprecated implementation removed 2019-12-03 15:36:31 +02:00
Filip Jagodzinski f1f9f45378 Test: Fix the reset_reason host test in the CI
Use a BaseHostTestAbstract.reset() method instead of
BaseHostTestAbstract.reset_dut() for more consistent behavior with
various platforms in the CI.

In contrast to a local setup, the reset_dut() method flashes the binary
again after performing the reset in a remote setup (RaaS). This was not
intentional in reset_reason tests. Moreover, this led to a different
behavior (a different reset_reason) for different flashing methods which
are target specific.
2019-10-24 13:04:13 +02:00
Martin Kojtal cd8753a1bd
Merge pull request #11540 from fkjagodzinski/test_update-usb_device-basic
Tests: USB: Update error handling in basic tests
2019-09-30 15:28:05 +02:00
Filip Jagodzinski 5432bb9c36 Tests: USB: Remove outdated docs from basic test 2019-09-30 11:56:51 +02:00
Filip Jagodzinski e0c87fccbe Tests: USB: Update error formatting in basic test 2019-09-30 11:56:51 +02:00
Filip Jagodzinski 3c37831521 Tests: USB: Extract common code in basic test 2019-09-30 11:56:50 +02:00
Filip Jagodzinski d4ef5f72e7 Tests: USB: Distinguish failure/error in basic test 2019-09-30 11:56:34 +02:00
Filip Jagodzinski bfcfb6cf4a Tests: USB: Clean up test failure output
Catch all pyusb errors and report failures to the device. Printing full
tracebacks was more confusing than useful.
2019-09-30 11:51:07 +02:00
Filip Jagodzinski 2b4b64fafd Tests: USB: Fix Python 3 compatibility
Use integer division explicitly in basic test.
Convert bytes to str for Python 3 in serial test.
2019-09-30 10:21:16 +02:00
Filip Jagodzinski 01e6bc5827 Tests: USBHID: Use libusb0 backend on Windows
libusb0 supports all features used for testing. A newer version
(libusb1) does not have a complete implementation for Windows.
2019-09-11 14:00:30 +02:00
Filip Jagodzinski db2995052f Tests: USB: Use libusb0 backend on Windows
libusb0 supports all features used for testing. A newer version
(libusb1) does not have a complete implementation for Windows.
2019-09-11 14:00:22 +02:00
Dustin Crossman 006adf3592 Fixed byte string related TypeError if using python3. 2019-08-29 13:28:43 -07:00
Martin Kojtal ccb63d771e
Merge pull request #10857 from ARMmbed/feature-watchdog
Add Watchdog and ResetReason
2019-07-03 11:43:52 +01:00
Martin Kojtal e40a76575f watchdog: fix copyright 2019-06-26 09:43:21 +01:00
Maciej Bocianski 4378c141df usb_device-msd test: disable host side unmount on windows machines 2019-06-19 14:32:21 +02:00
Maciej Bocianski 18285168fd usb_device-msd test: fix powershell unmount script issue
Running PowerShell script on some windows machines is blocked.
To avoid this problem script was replace by the code run directly in PowerShell console.
2019-06-19 14:32:20 +02:00
Filip Jagodzinski 337b394048 Tests: Watchdog: Update the reset-to-sync delay
Change the config parameter used as a delay before sending the sync
packet after the device reset in watchdog and reset_reason tests. Use
'forced_reset_timeout' instead of 'program_cycle_s'.
2019-05-24 12:23:38 +02:00
Filip Jagodzinski a37d03d640 Tests: Watchdog: Fix config access in the host script
Move the calls to get_config_item() to the setup() method. The config is
not available in the initializer yet.
2019-05-24 12:23:38 +02:00
Donatien Garnier 3ab0fbc7cf Update license headers 2019-05-24 12:23:35 +02:00
Filip Jagodzinski 76f7ca613a Tests: Drivers: Reset_reason: Add tests 2019-05-24 11:35:34 +02:00
Filip Jagodzinski f9497e5ed4 Tests: HAL API: Reset_reason: Add tests 2019-05-24 11:35:33 +02:00
Filip Jagodzinski c4d9300f9d Tests: HAL API: Watchdog: Add time accuracy tests 2019-05-24 11:35:28 +02:00
Filip Jagodzinski f1e744d4a0 Tests: HAL API: Watchdog: Add dev reset tests 2019-05-24 11:35:27 +02:00
Filip Jagodzinski 484b716c6e Tests: HAL API: Watchdog: Add tests 2019-05-24 11:35:26 +02:00
Olli-Pekka Puolitaival 842d145d91 Py3 fixes for test scripts 2019-05-08 13:46:01 +03:00
Filip Jagodzinski 852390fcdc Tests: USBHID: Make report test optional on Linux
This test case uses `hidapi` -- a cross-platform Python module.
To keep the initial Mbed setup as simple as possible, the `hidapi`
module is skipped on Linux hosts because of its external dependancies
for this platform.

The module can be easily installed following instructions from the
README file.
The test case is skipped if the host machine lacks `hidapi` module.
2019-04-09 17:03:22 +02:00
Filip Jagodzinski 36eb700ede Tests: USBHID: Handle variable driver setup time
Wait for the host driver to finish setup before sending any HID reports
from the device.

USBHID::wait_ready() blocks until the device reaches 'configured' state,
but the state of the host HID driver remains unknown to the device.
2019-04-09 17:03:22 +02:00
Filip Jagodzinski 572beb6731 Tests: USBHID: Add tests 2019-04-09 17:03:21 +02:00
Maciej Bocianski 7ff689be20 Add USB mass storage test 2019-02-27 17:18:41 +01:00
Russ Butler 6527cf2bad Update files to include SPDX-License-Identifier
Update the header of all files to use a newer license template which
includes SPDX-License-Identifier.
2019-02-22 10:53:24 -06:00
Filip Jagodzinski 38032453a5 Tests: USB: Fix 'endpoint halt' test
Abort all endpoint transfers before running the test again.
Use an updated vendor request to explicitly restart device reads.
2019-02-22 10:53:23 -06:00
Filip Jagodzinski 7db3a8a34a Tests: USB: DTR fix for Linux hosts
A DTR line is used to signal that the host has configured a terminal and
is ready to transmit and receive data from the USB CDC/Serial device.
When this test suite is run with the use of a Linux host, a workaround has
to be used to overcome some platform specific DTR line behavior.
Every time the serial port file descriptor is opened, the DTR line is
asserted until the terminal attributes are set.
As a consequence, the device receives a premature DTR signal with a
duration of 200-500 us before the correct, long-lasting DTR signal set by
the host-side test script. (tested on the Linux kernel 4.15.0)

The solution is to wait for the first DTR spike, ignore it, and wait for
the correct DTR signal again.
2019-02-22 10:53:21 -06:00
Russ Butler 930b29dd83 Tests: USB: Increase serial open retries
Double the number of attempts that are made to open a serial port.
This makes tests run more reliably on Windows.
2019-02-22 10:53:21 -06:00
Russ Butler 8f72f314d7 Tests: USB: Use DTR to make Serial tests reliable
Update the serial host test to set DTR low before opening a serial
port. Set DTR high once the serial object is ready. This ensures that
no data is sent by the device until the host is ready.
2019-02-22 10:53:21 -06:00
Filip Jagodzinski 31fe3ee11e Tests: USB: Increas the size of RX CDC test data
This ensures the flow control is tested.
2019-02-22 10:53:21 -06:00
Filip Jagodzinski 53f7cd5561 Tests: USB: Fix Windows USB SN handling 2019-02-22 10:53:21 -06:00
Filip Jagodzinski 3d4d10191c Tests: USB: Update code comments 2019-02-22 10:53:21 -06:00
Filip Jagodzinski edf360d2fc Tests: USB: Use SN generated by the host machine 2019-02-22 10:53:21 -06:00
Filip Jagodzinski dbfd43a098 Tests: USB: Wait before closing host's port
This delay eliminates the possibility of the device detecting the port
being closed when still waiting for data.
2019-02-22 10:53:20 -06:00
Filip Jagodzinski 7b80cb6586 Tests: USB: Add Serial test for line coding change 2019-02-22 10:53:20 -06:00
Filip Jagodzinski bf3aa29e0b Tests: USB: Use the serial number to find device
Use the USB device SN instead of VID & PID to find the device port name
on the host system.
2019-02-22 10:53:20 -06:00
Filip Jagodzinski 7a4b36c37f Tests: USB: Add tests for Serial class. 2019-02-22 10:53:20 -06:00
Filip Jagodzinski 3ed7d8139b Tests: USB: Add tests for CDC class. 2019-02-22 10:53:20 -06:00
Russ Butler cb6a6dbd20 Fix USB traceback during testing when wrong size
In the pyusb_basic host test check the length of control transfers
before comparing contents for equality.
2019-02-22 10:53:20 -06:00
Filip Jagodzinski 1f8bf46f2e Tests: USB: Check ep buffer is released by abort
Validate that endpoint buffer is not used after a transfer has been
aborted.
2019-02-22 10:53:20 -06:00
Filip Jagodzinski 36d4c355a9 Tests: USB: Update endpoint halt test
Wait for a locally created Timer thread to finish before returning.
2019-02-22 10:53:19 -06:00