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

TSCH: simple IPv6 communication test #2079

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

yatch
Copy link
Contributor

@yatch yatch commented Jan 18, 2017

Summary

This PR introduces a regression test to confirm if basic IPv6 communication is done successfully with TSCH and the z1 platform.

In the test, two nodes, TSCH Coordinator and TSCH Node, are created with the z1 platform. As soon as TSCH Node joins a network formed by TSCH Coordinator, the node sends a unicast packet and a broadcast packet to the coordinator by UDP. The coordinator sends back the received message to the node with the same communication type as the received packet, unicast or broadcast.

If and only if both of them receive one unicast message and one broadcast message, the test ends with success. Otherwise, the test fails.

It is said that some link error randomly occurs for the z1 platform, and it causes test failure. To prevent such a failure from making Travis red, the new test is marked with flaky as 19-z1-rpl-tsch.csc.flaky and others.

[UPDATE]
The same test for the cooja platform is also introduced.

Dependency

The test fails with the latest codebase. To make this test succeed, the following changes are needed:

How to Run

$ cd regression-tests/11-ipv6
$ java -Xshare:on -jar ../../tools/cooja/dist/cooja.jar -nogui=22-z1-tsch-simple-ipv6-test.csc.flaky  -contiki=../..

The test result can be found in COOJA.testlog

[success case]

$ tail COOJA.testlog
4147363 1 TSCH: send packet to 255 with seqno 2, queue 0 1, len 16 71
4149456 1 APP: send a broadcast packet
4150165 1 APP: done
4155176 1 TSCH: {asn-0.bd link-0-7-0-0 ch-25} bc-1-0 71 rx 2, edr 6
4244482 2 TSCH: received from 1 with seqno 65535
4245391 1 TSCH: {asn-0.c4 link-0-7-0-0 ch-15} bc-1-0 71 tx 0, st 0-1
4247260 2 APP: receive a broadcast packet
4247969 2 APP: done
TEST OK
Test ended at simulation time: 4247969

[failure case]

$ tail COOJA.testlog
7716816 2 TSCH: received from 1 with seqno 2
7718924 1 TSCH: {asn-0.1ab link-0-7-0-0 ch-20} uc-1-0 64 tx 2, st 0-1
7723552 2 TSCH: send packet to 1 with seqno 1, queue 0 1, len 21 64
7727475 2 TSCH: {asn-0.1ab link-0-7-0-0 ch-20} drift 0
7732976 2 TSCH: {asn-0.1ab link-0-7-0-0 ch-20} uc-1-0 64 rx 1, dr 0, edr 0
7821243 1 TSCH: received from 2 with seqno 1
7824741 2 TSCH: {asn-0.1b2 link-0-7-0-0 ch-26} uc-1-0 64 tx 1, st 0-1, dr 6
7827127 1 TSCH: {asn-0.1b2 link-0-7-0-0 ch-26} uc-1-0 64 rx 2, edr 6
TEST FAILED
Test ended at simulation time: 10016721

@yatch yatch mentioned this pull request Jan 18, 2017
@simonduq
Copy link
Member

Cool!
What would you think about switching this and the existing rpl-tsch test to platform Cooja, such as we can (re-)enable them in Travis? After all, the real goal is to test TSCH with the upper layers, rather than validate z1 / cc2420.

@yatch
Copy link
Contributor Author

yatch commented Jan 18, 2017

@simonduq Agree. In fact, I tried doing that yesterday with replacing z1 related lines with cooja ones in csc files. This didn't work well somehow. I can try it again, maybe soon.

<project EXPORT="discard">[APPS_DIR]/serial_socket</project>
<project EXPORT="discard">[APPS_DIR]/collect-view</project>
<project EXPORT="discard">[APPS_DIR]/powertracker</project>
<project EXPORT="discard">[APPS_DIR]/radiologger-headless</project>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line should be removed.

@simonduq
Copy link
Member

Yeah I think changing target directly in .csc files takes more than just a search and replace unfortunately. Different targets load different plugins etc. You might have to create cooja motes by hand (GUI) and look at the resulting csc.

@yatch
Copy link
Contributor Author

yatch commented Jan 18, 2017

@simonduq Something was wrong with me yesterday... See #2080.

@simonduq
Copy link
Member

Planning on porting this one as well to platform cooja?

@yatch
Copy link
Contributor Author

yatch commented Jan 19, 2017

@simonduq I was not; but it's a piece of cake. I've updated the branch with 22-cooja-tsch-simple-ipv6-test.csc. I made the test a little bit more robust by checking the link-layer destination address of a received frame.

I believe Travis will get red due to #1984.

@simonduq
Copy link
Member

test-driven development :)

@yatch
Copy link
Contributor Author

yatch commented Jan 20, 2017

@simonduq Yup, I like that style of development 😄

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

Successfully merging this pull request may close these issues.

None yet

2 participants