Basic Client and Server GET tests - kb2ma/RIOT GitHub Wiki
These tests use a simple GET request to exercise basic gcoap client and server functionality. The test infrastructure is based on two components:
- gcoaptest server -- a server implemented with our SOS CoAP Python library that accepts requests from a gcoap client.
- libcoap client -- a client implemented with the libcoap client example that sends requests to a gcoap server.
Client tests are implemented in riot2gcoaptest.py. See the file comments for how to run the tests.
| Test | Notes |
|---|---|
repeat-get |
Repeatedly sends a GET request to the test server. Can be combined with the repeat-get server test to exercise gcoap. Use the -c option to send requests confirmably. |
con-retries |
Sends a confirmable GET request to the test server. The server ignores a configurable number of requests, to test the client's ability to retry a confirmable request. Expects -r option for the number of requests/retries to ignore. Expects the client to time out if the server ignores 5 requests. |
toobig |
Sends a request where the response is too big for the gcoap input buffer. This test succeeds when gcoap times out on the response. We prefer the ability to read such a response; see Issue #26. |
toomany |
Sends requests to fill the buffer of open requests, to assure overflow is handled gracefully. Use the -c option to test overflow specific to a confirmable request. Test fails when client waits for a response (compiled with GCOAP_SEND_WAITS_FOR_RESPONSE) -- can't create overlapping requests. |
cmdargs |
Exercises command line argument handling without actually sending a request to a server. |
nohandler |
Verifies a response actually is received for a request when there is not a handler callback for the response. Requires use of riot-gcoap-test app, with DEBUG enabled in gcoap.c. |
Server tests are implemented in libcoap2riot.py. For the server, start the RIOT gcoap command line example. For the client, see the comments in the test file for how to run it.
| Test | Notes |
|---|---|
repeat-get |
Repeatedly receives a GET request from the libcoap client. Can be combined with the repeat-get client test to exercise gcoap. In other words, run the client test repeatedly (with the -r option), which provides a gcoap instance, and also is sending client requests. While that is running, run this server test repeatedly, too. |
toobig |
Receives a POST request that is too big for the gcoap input buffer. This test succeeds when gcoap times out. We prefer the ability to read such a request so we can send a 4.13 response (Request entity too large). See Issue #26. |
nopath |
Receives a GET request for /bogus, which the server does not understand. Returns a 4.04 response. |