Commit Graph

52 Commits (f6b910993458b3b7eeebb8181be16d719515416b)

Author SHA1 Message Date
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
Filip Jagodzinski c12e2d15f5 Tests: USB: Add data toggle test 2019-02-22 10:53:19 -06:00
Filip Jagodzinski ff8a9b6ae8 Tests: USB: Update endpoint tests
Fix the host script issues present on Windows machines.
Add 0 B payload size to bulk endpoints test.
Update halt and abort tests according to PR comments.
Add an explicit request to start reading on OUT endpoints.
2019-02-22 10:53:19 -06:00
Filip Jagodzinski 62dc95f60a Tests: USB: Generic: Update documentation 2019-02-22 10:53:19 -06:00
Filip Jagodzinski 686126b8ea Tests: USB: Generic: Add basic endpoint tests 2019-02-22 10:53:19 -06:00
Maciej Bocianski d66e576227 USB basic test documentation update 2019-02-22 10:53:15 -06:00
Maciej Bocianski fee14771e9 USB basic test update
disable suspend/resume test
disable sync frame test
improve reset test
2019-02-22 10:53:15 -06:00
Maciej Bocianski 12c91c3b7e pyusb_basic test update
test code refactoring
align test to use device multiconfiguration
2019-02-22 10:53:14 -06:00
Maciej Bocianski e85d5a33cd pyusb_basic test add helper functions 2019-02-22 10:53:14 -06:00
Maciej Bocianski 972fee6143 pyusb_basic test formatting fixes 2019-02-22 10:53:14 -06:00
Russ Butler 50adb03f88 Fix USB tests
Change the direction used in set interface to match the USB
specification. This allows USB tests to pass on OSX.
2019-02-22 10:53:13 -06:00
Russ Butler 0a787e7fe9 Skip USB reset tests on OSX
OSX machines don't allow you to reset USB devices. Skip this test on
OSX so testing can still be used.
2019-02-22 10:53:13 -06:00
Maciej Bocianski 49504d66ca Fix for USB set_clear_feature_test for OSX 2019-02-22 10:53:13 -06:00
Maciej Bocianski 33bef331e6 USB generic tests 2019-02-22 10:52:35 -06:00
Russ Butler f9f12766d8 Add USBDevice test code
Add a USB test and the class USBTester.cpp to go along with it.
2019-02-22 10:52:32 -06:00
Senthil Ramakrishnan 62d6eb5673 Increase the timeout for the host side script and the test 2019-01-22 16:04:47 -06:00
Brian Daniels 5625b6964d Fix Python 3 syntax in rtc host test 2019-01-03 12:04:36 -06:00
Senthil Ramakrishnan f59b99d889 Removing support for printing error-report after reboot and other minor fixes 2018-11-18 22:42:37 -06:00
Senthil Ramakrishnan 4ec30e3e8f Added greentea test 2018-11-16 14:00:00 -06:00
Cruz Monrreal 8bf51be75a
Merge pull request #8230 from mprse/issue_8214_fix
Fix for issue #8214
2018-10-12 21:24:08 -05:00
Shrikant Tudavekar dc8b1fa98f use forced_reset_timeout as delay after reset 2018-10-02 18:01:08 -05:00
Przemyslaw Stekiel 6d5e21741c Fix for issue #8214
Change the base time value to more realistic:
START_TIME = 1537789823 # GMT: Monday, 24 September 2018 11:50:23

This fix has been proposed by STM in order to enhance test efficiency.
Current test version did not detect problem with RTC reset on F1 family boards since the base time was too small.
2018-09-24 14:05:12 +02:00
David Saada b2b14ca26f Fix TRNG test to use reset from python script and not from code 2018-09-05 17:36:53 +03:00
Amir Cohen 1466518644 Fixing PR comments 2018-09-05 17:36:44 +03:00
Amir Cohen 669b618ea1 Add TRNG API test 2018-09-05 17:36:39 +03:00
Przemyslaw Stekiel c437e9d2c6 tests-mbed_hal-rtc_reset: Add ack from the device after each command is executed
RTC reset test was failing when board has been just powered and RTC reset test was executed for the first time (issue has been detected on CI). In such case RTC initialization takes more time than in futher rtc_init calls. This has impact on green-tea communication. Commands send by host immediately after init command (write, read) were not handled on the device side and no response to the host was provided.
To fix this problem test communication flow has been modified. Device sends ack to the host after RTC init is done. Host sends further RTC commands when ack from the device has been received.

Edit:
There are still some communication issues on the CI. Add ack from the device after each executed command. Increase test timeout and wait after reset.
2018-05-25 12:52:02 -05:00
Russ Butler 1f97f11373 Add documentation and test the HAL RTC API
Add requirements, tests, an example implementation and additional
function documentation to the HAL RTC API.
2018-05-25 12:37:19 -05:00
Brian Daniels 631e5ebdee Modifying echo test to be driven more from the device.
Previously, the echo test followed a flow like the following:

-STEP-	-HOST PC-                  -DEVICE-
0	send _sync
1				   echo back _sync
2				   send echo_count
3	echo back echo_count
4	send first echo packet
5				   echo back echo packet
	(repeat echo steps)

However, as noted by issue #6659, this test would somtimes fail between
steps 4 and 5. To ensure each KV pair makes to the correct destination,
we usually write the KV back. Step 4 does not wait for this to happen
and starts sending echo packets. So the device is acting as the "echo
server".

This change makes the host PC the "echo server". The idea being that the
device will be slower and the host pc should always be able to keep up
with it, not the other way around.
2018-04-23 17:56:13 -05:00
Bartek Szatkowski 73b054601d Add tests for system_reset() 2018-02-28 16:42:34 +00:00
Przemyslaw Stekiel e725b4c2c5 RTC time conversion test - reduce number of tested years in order to reduce test execution time.
For each of the following years test example time of the first and last day of each month:
- first - 1970
- example not leap year (not divisible by 4)
- example leap year (divisible by 4 and by 100 and by 400)
- example leap year (divisible by 4 and not by 100)
- example not leap year (divisible by 4 and by 100)
- last fully supported  - 2105

Test execution time on K64F is now ~39 sec.
2018-01-08 10:14:54 +01:00
Przemyslaw Stekiel fcdaeccea1 Add tests for extended RTC. 2017-12-05 07:53:41 +01:00
Russ Butler f535cb5ddc Update timing calculations 2017-06-28 16:29:38 -05:00
studavekar 0f55193df8 Update timing tests to be robust.
In the new approach the host controls the device activity when the test
should start, finish and pass/fail status is send to device. Also deprecate
the test cases which can't accurately test.
2017-06-22 18:25:16 -05:00