RIOT icon indicating copy to clipboard operation
RIOT copied to clipboard

tests/gcoap_fileserver: add integration test for GCoAP fileserver

Open benpicco opened this issue 3 years ago • 3 comments

Contribution description

This adds an integration test for the GCoAP fileserver / NanoCoAP blockwise get connected over a lossy, simulated 802.15.4 link.

Two nodes are launched, one acting as the fileserver, the other as a client. The server serves a file from constfs that the client downloads with ncget.

Then the hash of the downloaded file is compared with the original file. The test will fail if there is no match.

Testing procedure

Run

make -C tests/gcoap_fileserver test

Issues/PRs references

benpicco avatar Jun 12 '22 20:06 benpicco

This adds an integration test for the GCoAP fileserver / NanoCoAP blockwise get connected over a lossy, simulated 802.15.4 link.

Two nodes are launched, one acting as the fileserver, the other as a client. The server serves a file from constfs that the client downloads with ncget.

Then the hash of the downloaded file is compared with the original file. The test will fail if there is no match.

That's a good text to go into a README in the test.

chrysn avatar Jun 14 '22 10:06 chrysn

I've given this some testing, and am confused by the outcomes:

When just doing make all test, things run through fine.

When I reduce retransmissions from 10 to -DCONFIG_COAP_MAX_RETRANSMIT=2, I haven't had a single test failure in 3 runs. That's highly unlikely with a 0.75 success rate per link, giving < 50% chance of any single round trip, so even a single-block test should fail ever now and then, let alone anything with multiple blocks.

chrysn avatar Sep 14 '22 07:09 chrysn

Ah good catch! I missed that native would echo the command, so A.cmd("md5sum /const/song.txt").split()[0] would always return md5sum.

There are still link-layer retransmissions, but if we get rid of those with

CFLAGS += -DCONFIG_IEEE802154_DEFAULT_MAX_FRAME_RETRANS=1

things are failing as expected.

benpicco avatar Sep 14 '22 11:09 benpicco

Thank you!

benpicco avatar Sep 29 '22 11:09 benpicco