-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
devfs: add /dev/urandom and /dev/hwrng #7421
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my comments inline
|
Sorry for the very long delay in reviewing this PR. Feel free to squash |
2a8a778
to
5826a06
Compare
squashed, and added a test in devfs unittests. I don't have hardware with me right now, so I didn't run the /dev/hwrng unittest. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we can do any tests on the actual bytes that are produced by the read of the /dev/urandom, /dev/hwrng file, but only test to see that the return value from read is correct and that the bytes they are at least not all unchanged. We should not assume they are all changed though.
The unit tests completed successfully on Mulle, though the check needs to be changed to avoid false negatives depending on the hwrng data |
This is based on a quite old base commit, could you rebase please while fixing the unit test? |
5826a06
to
cf25c29
Compare
Fixed unittest (amended directly) and rebased. Tested on our hardware (stm32). |
Fixed auto init call from unittests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, what do you think about using a pseudomodule for the devfs nodes?
@@ -141,11 +143,39 @@ static void test_devfs_mount_open(void) | |||
TEST_ASSERT_EQUAL_INT(0, res); | |||
} | |||
|
|||
static void test_devfs_urandom(void) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather unrelated, but this whole test suite should go into its own application.
Needs rebase. @gebart @vincent-d are there any plans to continue this? |
needs rebase |
@vincent-d still active and care to rebase this one? Just tested after rebasing, works -> would merge. |
@smlng active I am, though not much on RIOT recently ;) If it's simply a rebase, I can do. If it needs more changes, I'm afraid won't have time. |
rebased |
Please squash |
squashed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM ACK
@gebart not sure if you are available, but if so: please recheck and ACK or dismiss you review. I'll leave this open for a few days but would then dismiss your review and merge this. |
no response, but comments are addressed
@leandrolanzieri a pointer, as you were interested and said @jcarrano might find this useful, too. |
This requires having |
@cladmi: you refer to the fact that now fewer boards can run the unit tests, bc some do not have the required feature, right? That's kind of the problem with the monolithic unittest binary (IMHO)?! |
The release specs task And yes it is a problem with being monolithic. I will do a PR to split this test out for the release. |
This PR adds a
/dev/urandom
file to the devfs registry whenperiph_hwrng
is available.