iou
iou copied to clipboard
Add single timeout test
Add a dedicated test file for single timeouts.
It's currently failing on my machine, but running cargo +nightly test --no-fast-fail
I can see that only the timeout test fails.
Maybe this could be an ad-hoc check of which features your kernel supports?
I don't want to merge any tests that will fail on the kernel version I'm currently using to run tests, but I do want to merge this code eventually, so let's leave this PR open for now.
We need a system in which each test can easily specify, if necessary, which minimum kernel version they require. We should not need to go more granular to major.minor, I believe.
Then, we need either: a) a way for users to explicitly pass which version they want to run tests for, or b) a way for tests to receive which kernel they are testing under (by shelling out somehow to uname -r
for example).
I expect this can be set up through Rust's #[cfg]
attributes (see the cfg_if crate for example of this sort of thing) and cargo features somehow, but I haven't looked into it at all.
This also ties into #6! I haven't even looked into setting up proper CI either instead of running tests myself, I have no idea what kernel support our available CI options will have.
Once we have that system in place we could also consider using it for the APIs as well as the tests, so users will have to explicitly opt into the APIs that require a kernel version greater than whatever a reasonable minimum is (and we would have to set a policy around that as well).
Right, that sounds like a good plan :)
way for tests to receive which kernel they are testing under
For future reference, two concrete ways to find the kernel version could be: https://docs.rs/nix/0.17.0/nix/sys/utsname/struct.UtsName.html https://docs.rs/cluuname/0.1.9/cluuname/fn.uname.html
These are both "stringily" typed, it would be nice to have a little version number parser abstraction around them.
I just revised the timeout test to use the 0.3
APIs.