testing: add periph I2C robot tests for HIL#10147
testing: add periph I2C robot tests for HIL#10147smlng wants to merge 6 commits intoRIOT-OS:masterfrom
Conversation
|
I ran the test on the nrf52dk (that supports reset on p21) with PHiLIP-N and all tests passed but When I tried with sudo and just |
|
I think I remove the |
2f87601 to
02c4730
Compare
1d10d3a to
5717d91
Compare
This introduces a new environment variable for a common directory that holds all output of the build process, such as application or package binaries. This would also allow to easily redirect output to any other location, e.g. for out-of-source builds.
|
|
||
| *** Keywords *** | ||
| DUT Must Have Periph I2C Application | ||
| API Call Should Succeed I2C Get ID |
There was a problem hiding this comment.
To prevent initial error from connecting and resetting I think it would be good to send the I2C Get ID command once without any checks first, then send and check the id. Either include it here or do it before calling this keyword.
There was a problem hiding this comment.
okay, will add a simple I2C Get ID without checking the result before this line
|
|
||
| Suite Setup Run Keywords Reset DUT and PHILIP | ||
| ... DUT Must Have Periph I2C Application | ||
| Test Setup Reset DUT and PHILIP |
There was a problem hiding this comment.
I think each test should include a DUT Must Have Periph I2C Application or at least send the I2C Get ID without checks. Maybe make a clear buffers command that does that.
There was a problem hiding this comment.
so basically Test Setup should be the same as Suite Setup
|
Also I think it would be good for all data driven tests to have a acquire and release around it (maybe this can be done with the setup and teardown) |
|
also add the riot_pal version to the metadata |
|
... Also grep for verfiy, I think there are a few places that this occurs. |
|
hmmm, my suggestions still don't solve the remote-revb problems. Maybe a retry command n times would be better. Sometimes it takes 2 timeouts after the reset to recover. |
|
Here is my brute force solution for the remote-revb problems (but this should also help many other initial connection problems --- a/tests/periph_i2c/tests/01__periph_i2c_base.robot
+++ b/tests/periph_i2c/tests/01__periph_i2c_base.robot
@@ -2,8 +2,13 @@
Documentation Basic tests to verify functionality of the periph I2C API.
Suite Setup Run Keywords Reset DUT and PHILIP
+... I2C Get ID
+... I2C Get ID
... DUT Must Have Periph I2C Application
-Test Setup Reset DUT and PHILIP
+Test Setup Run Keywords Reset DUT and PHILIP
+... I2C Get ID
+... I2C Get ID
+... I2C Get ID
Resource periph_i2c.keywords.txt
Resource api_shell.keywords.txt
diff --git a/tests/periph_i2c/tests/02__periph_i2c_write_register.robot b/tests/periph_i2c/tests/02__periph_i2c_write_register.robot
index 206013009..c73658cb1 100644
--- a/tests/periph_i2c/tests/02__periph_i2c_write_register.robot
+++ b/tests/periph_i2c/tests/02__periph_i2c_write_register.robot
@@ -2,8 +2,14 @@
Documentation Data driven tests to verify writing to a valid register.
Suite Setup Run Keywords Reset DUT and PHILIP
+... I2C Get ID
+... I2C Get ID
... DUT Must Have Periph I2C Application
-Test Setup Reset DUT and PHILIP
+Test Setup Run Keywords Reset DUT and PHILIP
+... I2C Get ID
+... I2C Get ID
+... I2C Get ID
+
Test Template I2C Write Bytes To Register Should Succeed
Resource periph_i2c.keywords.txt |
yeah Test Setup and Test Teardown would be the best way, so we do not clutter the actual test |
what do you mean? |
you mean |
|
Very nice. I like the changes and it seems to improve the non i2c related issues. |
This introduces a new way to write RIOT tests using the RobotFramework, starting by adding new make targets for easy usage.
This adds a couple of tests already ported to RobotFramework.
Add simple wrapper to run static-tests using RobotFramework, this adds some nice HTML-output for free.
Add initial support for the periph_i2c test for the RobotFramework.
|
Would you mind creating a version that does not depend on robot? No need to stall HIL testing for a framework discussion. |
No issue here: HIL testing is deployed and working. No need to intermingle with the asynchronous framework discussion. |
Then we can close this? |
|
@kaspar030 please don't, at the moment we are using this for the HiL results in the nighties (and I have been using it for i2c improvements that can use some review 😉) |
Checkout the tests/periph_i2c/tests/test.py (it doesn't use test runner and was meant as an example of what should be tested but it is an independent test). |
I know, and I didn't intent to. I tried to clarify what @tcschmidt means by "this is deployed and working" vs. there's an open PR. edit deleted accidental duplicate post |
|
@kaspar030 the point is simple: Framework discussion is asynchronous, nothing more. |
|
closing in favour of #10774 |
Contribution description
This adds a new test suite for the I2C peripheral drivers based on the RobotFramework and PHiLIP to allow for hardware-in-the-loop (HIL) testing.
Testing procedure
To run this you need a board (device under test) hooked up to a PHILIP test board, see https://github.com/riot-appstore/PHiLIP . Then run
BOARD=<fill in> make -C tests/periph_i2c flash robot-test.Issues/PRs references
depends on #10095