Skip to content

tests: provide test case for malformed IEEE 802.15.4 packets - #11401

Merged
miri64 merged 1 commit into
RIOT-OS:masterfrom
miri64:tests/enh/i11398-testcase
Sep 26, 2019
Merged

tests: provide test case for malformed IEEE 802.15.4 packets#11401
miri64 merged 1 commit into
RIOT-OS:masterfrom
miri64:tests/enh/i11398-testcase

Conversation

@miri64

@miri64 miri64 commented Apr 15, 2019

Copy link
Copy Markdown
Member

Contribution description

This provides a test case for #11398

Testing procedure

Compile and run the test on native.

make -C tests/gnrc_netif_ieee802154/ all test

Revert 3c19aa7 and compile and run again. This time the test will fail.

Issues/PRs references

Provides regression test for #11399.

@miri64 miri64 added Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation Area: network Area: Networking Area: tests Area: tests and testing framework CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Apr 15, 2019
@miri64
miri64 requested a review from a user April 15, 2019 16:03
@miri64
miri64 force-pushed the tests/enh/i11398-testcase branch from 9364d56 to 097036c Compare April 15, 2019 16:03
@miri64

miri64 commented Apr 19, 2019

Copy link
Copy Markdown
Member Author

Ping? We should merge this test case soonish to prevent regression.

@miri64

miri64 commented Apr 19, 2019

Copy link
Copy Markdown
Member Author

Mhhh. Murdock seems to have a problem with the sockets. @kaspar030 any idea what's happening?

@miri64 miri64 added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Apr 19, 2019
@miri64

miri64 commented Apr 26, 2019

Copy link
Copy Markdown
Member Author

Ping @kaspar030?

@miri64 miri64 added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Apr 26, 2019
@kaspar030

Copy link
Copy Markdown
Contributor

Mhhh. Murdock seems to have a problem with the sockets. @kaspar030 any idea what's happening?

I think docker containers don't have ipv6 enabled.

@miri64

miri64 commented Apr 26, 2019

Copy link
Copy Markdown
Member Author

Mhhh. Murdock seems to have a problem with the sockets. @kaspar030 any idea what's happening?

I think docker containers don't have ipv6 enabled.

Not nice. Let's see how it deals with an IPv4 socket then.

@miri64 miri64 added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Apr 26, 2019
@miri64

miri64 commented Apr 26, 2019

Copy link
Copy Markdown
Member Author

Works :-)

@miri64

miri64 commented Apr 29, 2019

Copy link
Copy Markdown
Member Author

Works :-)

Then again it doesn't because now the test still works when I revert 3c19aa7. :-/. For now I revert the last commit

@miri64

miri64 commented Apr 29, 2019

Copy link
Copy Markdown
Member Author

I think docker containers don't have ipv6 enabled.

@cladmi any idea why?

@kaspar030

Copy link
Copy Markdown
Contributor

@cladmi any idea why?

(as discussed offline) This is just Docker's default configuration, see https://docs.docker.com/v17.09/engine/userguide/networking/default_network/ipv6/.

So this is not a container option, but a container runtime configuration issue.
If we really need that, we could probably configure the workers accordingly. @smlng I assume k8s doesn't have problems configuring IPv6?

@miri64

miri64 commented Apr 29, 2019

Copy link
Copy Markdown
Member Author

Then again it doesn't because now the test still works when I revert 3c19aa7. :-/. For now I revert the last commit

The problem on my local machine at least was that some weird other address (2.somethingsomething; looked like garbage) was returned by getaddrinfo for localhost, 0.0.0.0 and 127.0.0.1 here

if ((res = real_getaddrinfo(params->local_addr, params->local_port, &hints,
&ai)) < 0) {
errx(EXIT_FAILURE, "ZEP: unable to get local address: %s\n",
gai_strerror(res));
}

and here

if ((res = real_getaddrinfo(params->remote_addr, params->remote_port, &hints,
&ai)) < 0) {
errx(EXIT_FAILURE, "ZEP: unable to get remote address: %s\n",
gai_strerror(res));
}

@miri64

miri64 commented Apr 29, 2019

Copy link
Copy Markdown
Member Author

(so the socket is bound to a non-existing address, so it isn't able to receive anything so the packet that triggers a bogus packet without 3c19aa7 is never received :-/)

@miri64

miri64 commented Apr 29, 2019

Copy link
Copy Markdown
Member Author

If we really need that, […]

Since RIOT doesn't even speak IPv4 I think it is important for our main testing environment to support IPv6, no?

@miri64

miri64 commented Apr 29, 2019

Copy link
Copy Markdown
Member Author

Since RIOT doesn't even speak IPv4 I think it is important for our main testing environment to support IPv6, no?

(without packages ;-))

Comment thread tests/gnrc_netif_ieee802154/tests/01-run.py Outdated
@cladmi

cladmi commented Apr 30, 2019

Copy link
Copy Markdown
Contributor

On my machine there is no failure when run with the ipv4 case.

I before tried to only have the script with ipv4 without changing riot configuration… as I did not thought about it, and it worked.

I think that sending a "please tell me you answer" first or last packet could help ensuring we are sending to the right destination.

@miri64

miri64 commented Apr 30, 2019

Copy link
Copy Markdown
Member Author

I think that sending a "please tell me you answer" first or last packet could help ensuring we are sending to the right destination.

Done

@miri64

miri64 commented Apr 30, 2019

Copy link
Copy Markdown
Member Author

Pushed the IPv4 version again, so we can see what murdock is saying about it.

@miri64
miri64 force-pushed the tests/enh/i11398-testcase branch from 1e2db4d to bd93502 Compare April 30, 2019 20:23
@cladmi

cladmi commented Apr 30, 2019

Copy link
Copy Markdown
Contributor

On my machine ipv4 does not work as well, I do not receive the valid packet.
So it is not only on your machine :)

@miri64

miri64 commented Apr 30, 2019

Copy link
Copy Markdown
Member Author

On my machine ipv4 does not work as well, I do not receive the valid packet.
So it is not only on your machine :)

Same goes for Murdock... I guess we need to fix socket_zep first to get this test merged ^^

@cladmi

cladmi commented May 2, 2019

Copy link
Copy Markdown
Contributor

Or IPv6 in the test environments.

@miri64 miri64 changed the title tests: provide testcase for issue 11398 tests: provide test case for malformed IEEE 802.15.4 packets May 2, 2019
@ghost
ghost removed their request for review May 3, 2019 07:41
@miri64

miri64 commented Jul 25, 2019

Copy link
Copy Markdown
Member Author

I think it was the test after all. I have a new machine now, and there the test also failed. Will fix.

@miri64

miri64 commented Jul 25, 2019

Copy link
Copy Markdown
Member Author

Fixed

@miri64

miri64 commented Jul 25, 2019

Copy link
Copy Markdown
Member Author

@miri64

miri64 commented Jul 25, 2019

Copy link
Copy Markdown
Member Author

(by porting the test to scapy... while it still uses sockets, afaik Murdock does not have scapy installed ;-))

@miri64

miri64 commented Aug 9, 2019

Copy link
Copy Markdown
Member Author

Once RIOT-OS/riotdocker#77 is deployed, this test should work again. @kaspar030 @smlng any timeline on this?

@miri64

miri64 commented Sep 10, 2019

Copy link
Copy Markdown
Member Author

Let's try it. ;-)

@miri64 miri64 added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Sep 10, 2019
Comment thread tests/gnrc_netif_ieee802154/tests/01-run.py Outdated
@benpicco benpicco added the CI: run tests If set, CI server will run tests on hardware for the labeled PR label Sep 25, 2019
@benpicco

Copy link
Copy Markdown
Contributor

Murdock only complains about Pull request needs squashing so it looks like scapy has been deployed.

So why not make Murdock firmly happy and squash :)

@miri64
miri64 force-pushed the tests/enh/i11398-testcase branch from 9dd114d to 6f6cf6d Compare September 25, 2019 20:30
@miri64

miri64 commented Sep 25, 2019

Copy link
Copy Markdown
Member Author

Squashed and rebased

@miri64
miri64 force-pushed the tests/enh/i11398-testcase branch from 6f6cf6d to aaaa8a2 Compare September 26, 2019 13:56
@miri64

miri64 commented Sep 26, 2019

Copy link
Copy Markdown
Member Author

I noticed an error in the test script. It should now be fixed.

@miri64

miri64 commented Sep 26, 2019

Copy link
Copy Markdown
Member Author

(i.e. please make sure to follow the testing procedures before merging ;-))

@haukepetersen haukepetersen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reasoning is valid to me, so is the code. Test runs as expected -> ACK

@miri64

miri64 commented Sep 26, 2019

Copy link
Copy Markdown
Member Author

Thanks for the review!

@miri64
miri64 merged commit ac9e80c into RIOT-OS:master Sep 26, 2019
@miri64
miri64 deleted the tests/enh/i11398-testcase branch September 26, 2019 14:57
@kb2ma kb2ma added this to the Release 2019.10 milestone Sep 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: network Area: Networking Area: tests Area: tests and testing framework CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR CI: run tests If set, CI server will run tests on hardware for the labeled PR Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants