-
Notifications
You must be signed in to change notification settings - Fork 410
OSCORE integration & unit tests #1180
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
Conversation
I noticed that the many tests are broken now so I have to fix them before I add more tests. |
8cfbed6
to
f46a65b
Compare
f46a65b
to
f385c42
Compare
About pure unit tests - I'm not sure how add some because a lot of code modified by OSCORE support don't have tests at all (e.g. ServersInfoExtractor, BootstrapUtil, ConfigurationChecker, InMemoryBootstrapConfigStore). I think the better way is add unit tests while implementing new classes (e.g. OSCORE store) or adding new/missing functionality (OSCORE redis support). |
I created PR #1186 which fix OSCORE tests in redis variant. |
@Michal-Wadowski sorry I didn't find time to look at this, I will be unavailable until 5th January. I will try to look at this when I'm back. |
I will try to look at this. |
I think just ignoring it by adding this 👇 in @Test
@Ignore
@Override
public void registered_device_with_oscore_to_server_with_oscore()
throws NonUniqueSecurityInfoException, InterruptedException {
// Redis security store does support oscore for now.
} |
I successfully run Tests in Eclipse but using It seems Tests are very unstable (more than usually)
or
or
Does it works for you ? (Not sure but this is maybe because of the static Oscore**Handler stuff) |
Changing this in root pom.xml make the maven test OK. <plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M4</version>
<configuration>
<systemPropertyVariables>
<logback.configurationFile>logback-leshan-test.xml</logback.configurationFile>
</systemPropertyVariables>
<parallel>classes</parallel>
- <threadCount>4</threadCount>
+ <threadCount>1</threadCount>
<excludes>
<exclude>**/*$*</exclude>
</excludes>
</configuration>
</plugin> I think it reinforces the idea that there is a shared state between the tests that creates the problem. |
Yes, temporarily is solve problem not passing tests. But I created #1186 that handles this issue.
I also got some problems with not passing tests randomly. But re-run often helped so I wasn't sure what was about. In current PR I fixed shared OSCORE handler at least. |
@Michal-Wadowski, I propose a plan at #725 (comment) Regarding 1, do you think that this 👇 :
do the job ? |
@sbernard31 - I totally agree with you. We can temporarily skip the Redis Tests and merge current work with oscore branch. |
I integrated this in You can try to do the rebase of the |
I added few integration tests to check combinations:
The last test is disabled because current implementation seems not working well with this combination.
In RedisSecurityTest the "registered_device_with_oscore_to_server_with_oscore" test fails because redis serializer is not adjusted to OSCORE yet.
By the way of the tests I had to split OscoreHandler to three classes (OscoreBootstrapHandler, OscoreServerHandler, OscoreClientHandler) because they use static field and while testing the client/server/bootstrap messed up each other's context.