Skip to content
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

Make LWM2M Zephyr integration tests pass ✅ #1537

Closed
sbernard31 opened this issue Nov 9, 2023 · 12 comments
Closed

Make LWM2M Zephyr integration tests pass ✅ #1537

sbernard31 opened this issue Nov 9, 2023 · 12 comments

Comments

@sbernard31
Copy link
Contributor

sbernard31 commented Nov 9, 2023

Recently @SeppoTakalo add some integration tests based on Leshan in Zephyr project : zephyrproject-rtos/zephyr#64013

But there is some tests which can not pass because of Issues/limitations of leshan-server-demo.

This is issue aims to track work about make all tests green ✅.

Identified issues/limitations :

Description Comment Fix
Root Path is not yet supported by Leshan. Integrated in master now. ✔️ #1534
Leshan don't allow writing attributes to resource instance That' was a bug.
It must be fixed in master.
✔️ b0ef051
Leshan only supports passive cancelling Integrated in master now. ✔️ 2afadfc
@sbernard31
Copy link
Contributor Author

sbernard31 commented Nov 9, 2023

@SeppoTakalo, let me know if this is OK to you to test if Leshan modification help to pass tests. 🙏

For write attributes this should be OK in master now.
For root path, I will work on it very soon.
Then I will work on active cancel.

@SeppoTakalo
Copy link

Hi @sbernard31
Yes, I would very much like to try out there changes.

I have no knowledge of Java or how to build the .jar package from the demo servers, so I might need to study a bit, if I can easily test.

Or, if the changes are already in here https://ci.eclipse.org/leshan/job/leshanci/job/master/lastSuccessfulBuild/artifact/leshan-server-demo.jar then I can verify.

@sbernard31
Copy link
Contributor Author

sbernard31 commented Nov 10, 2023

Yes, I would very much like to try out there changes.

Great ! 👍

I have no knowledge of Java or how to build the .jar package from the demo servers, so I might need to study a bit, if I can easily test.
Or, if the changes are already in here https://ci.eclipse.org/leshan/job/leshanci/job/master/lastSuccessfulBuild/artifact/leshan-server-demo.jar then I can verify.

I understand, I will let you know where to get the jar file.
For now, writing attributes fix should already be available at : https://ci.eclipse.org/leshan/job/leshanci/job/master/lastSuccessfulBuild/artifact/leshan-server-demo.jar

@SeppoTakalo
Copy link

I figured out how to build the JAR file. Docker rescued me from learning to install proper toolchains.

docker run -it --rm --name my-maven-project -v "$(pwd)":/usr/src/mymaven -v "$HOME/.m2":/root/.m2 -w /usr/src/mymaven maven:3-openjdk-17 mvn clean install

Now writing attributes to resource instance 3/0/7/0 seem to work:

❯ curl -i  -X PUT  "http://localhost:8080/api/clients/native_posix/3/0/7/0/attributes?pmin=1&pmax=20"
HTTP/1.1 200 OK
Date: Fri, 10 Nov 2023 11:35:18 GMT
Content-Type: application/json
Content-Length: 69
Server: Jetty(9.4.51.v20230217)

{"status":"CHANGED(204)","valid":true,"success":true,"failure":false}%

Screenshot from 2023-11-10 13-39-26

@sbernard31
Copy link
Contributor Author

sbernard31 commented Nov 10, 2023

@SeppoTakalo, support of "/" in Read-Composite is now available in `master. ✔️ (and so at :https://ci.eclipse.org/leshan/job/leshanci/job/master/lastSuccessfulBuild/artifact/leshan-server-demo.jar)

Next step "observe active cancel". Maybe I will work on it next week. 🤷‍♂️

@sbernard31
Copy link
Contributor Author

@SeppoTakalo I just added an API for "observe active" cancel.

Some details about the API at : #1538 (comment)

This should be available in master (and so in https://ci.eclipse.org/leshan/job/leshanci/job/master/lastSuccessfulBuild/artifact/leshan-server-demo.jar)

Let me know if you succeed to pass all Zephyr integrations test now 🙏

@SeppoTakalo
Copy link

Remaining testcases from 100 - 399 range now implemented and pass:
zephyrproject-rtos/zephyr#65482

@sbernard31
Copy link
Contributor Author

Great 🎉 !

@SeppoTakalo Thx a lot for your help on this 🙏 I really appreciate it !

Do no hesitate to contact me or Leshan project, if you face any interoperability issues in the future.
(And do not forget to comment eclipse-wakaama/wakaama#617, if you have some thought to share about that)

I think we can close this issue now ✅ !

@SeppoTakalo
Copy link

@sbernard31
One thing, probably minor, came to my mind. I hope this is not a wrong forum to ask it.

If we continue to use the Demo server for testing purposes, we tend to have a Dockerfile that usually contains the link where to fetch the .jar file. Like: https://ci.eclipse.org/leshan/job/leshan/lastSuccessfulBuild/artifact/leshan-bsserver-demo.jar

However, the problem is that this link stays static, even when the content changes. Docker caches the result, so there is no clean way to update the .jar.

Is there any intention to branch, tag or release, so that we could point somewhere where our Dockerimage would be able to fetch a tagged release of that jar?

@sbernard31
Copy link
Contributor Author

@SeppoTakalo

master branch

https://ci.eclipse.org/leshan/job/leshan/lastSuccessfulBuild/artifact/leshan-*-demo.jar is the result of our CI build for master branch.

However, the problem is that this link stays static, even when the content changes. Docker caches the result, so there is no clean way to update the .jar.

I don't know how it works but if you want to download master version maybe you can use wget with option:

-N --timestamping: Turn on time-stamping. See section Time-Stamping for details.

milestone release

We do some milestone releases. Artifacts are deployed on maven central : https://central.sonatype.com/namespace/org.eclipse.leshan

Example for release 2.0.0-M13 of leshan-server-demo : https://maven.org/maven2/org/eclipse/leshan/leshan-server-demo/2.0.0-M13/leshan-server-demo-2.0.0-M13-jar-with-dependencies.jar

stable release

Currently there is no stable release for Leshan 2.x. Only for Leshan 1.x which support only LWM2M v1.0.x.

@SeppoTakalo
Copy link

Ah, the Maven central seems to be what I was looking for.
Once those features in current master (root path, active cancelling) are in some of the milestone release, I can change the Dockerfile to point into that.

Thanks.

@sbernard31
Copy link
Contributor Author

sbernard31 commented Nov 21, 2023

OK 2.0.0-M14 should be released soon with all feature we talked about here : #1531

@jvermillard jvermillard changed the title Make LWM2M Zephy integration tests pass ✅ Make LWM2M Zephyr integration tests pass ✅ Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants