From 20fd6f2b50b804deb9edf7a5ee82a32d8835138d Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sat, 23 May 2020 16:41:26 -0700 Subject: Tests for sending large amounts of data over NNG TLS streams. This also starts the test framework NNG streams, so that we can test those more directly. --- tests/testutil.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'tests/testutil.h') diff --git a/tests/testutil.h b/tests/testutil.h index a297b603..15028106 100644 --- a/tests/testutil.h +++ b/tests/testutil.h @@ -56,6 +56,24 @@ extern int testutil_marry(nng_socket, nng_socket); extern int testutil_marry_ex( nng_socket, nng_socket, const char *, nng_pipe *, nng_pipe *); +// testutil_stream_send_start and testutil_stream_recv_start are used +// to initiate transfers asynchronously. They return a token which can +// be used with testutil_stream_send_wait and testutil_stream_recv_wait. +// Those wait functions will return the result of operation (0 on +// success, an NNG error number otherwise.) +extern void *testutil_stream_send_start(nng_stream *, void *, size_t); +extern void *testutil_stream_recv_start(nng_stream *, void *, size_t); +extern int testutil_stream_send_wait(void *); +extern int testutil_stream_recv_wait(void *); + +// These are TLS certificates. The client and server are signed with the +// root. The server uses CN 127.0.0.1. Other details are bogus, but +// designed to prevent accidental use elsewhere. +extern const char *testutil_server_key; +extern const char *testutil_server_crt; +extern const char *testutil_client_key; +extern const char *testutil_client_crt; + // TEST_NNG_PASS tests for NNG success. It reports the failure if it // did not. #define TEST_NNG_PASS(cond) \ -- cgit v1.2.3-70-g09d2