From 8829c2f365d33f10d46f0c98a239a5a292abf811 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Mon, 16 Apr 2018 19:52:28 +0800 Subject: [PATCH] selftests This converts several of the selftests to return a status in their exit code about whether they 'worked'. A small bash script framework is added, with a selftest.sh in the mininmal example dirs that support it, and a ./minimal-examples/selftests.sh script that can be run from the build dir with no args that discovers and runs all the selftest.sh scripts underneath. That is also integrated into travis and the enabled tests must pass now for travis to pass. Travis does not have a modern libuv so it can't run a couple of tests which are nulled out if it sees it's running in travis env. --- .travis.yml | 2 +- lib/event-libs/libuv.c | 2 +- lib/libwebsockets.c | 8 +- lib/libwebsockets.h | 8 +- lib/roles/h2/http2.c | 29 ++++--- lib/roles/h2/ops-h2.c | 2 +- lib/roles/http/client/client.c | 2 +- lib/roles/http/header.c | 4 +- lib/roles/ws/ops-ws.c | 2 +- lib/service.c | 4 +- lib/tls/openssl/ssl.c | 2 +- .../minimal-http-client-certinfo.c | 6 ++ .../minimal-http-client-hugeurl.c | 12 ++- .../minimal-http-client-hugeurl/selftest.sh | 42 +++++++-- .../minimal-http-client-multi.c | 18 +++- .../minimal-http-client-multi/selftest.sh | 52 +++++++++++ .../minimal-http-client-post.c | 6 ++ .../minimal-http-client-post/selftest.sh | 33 +++++++ .../minimal-http-client/minimal-http-client.c | 6 ++ .../minimal-http-client/selftest.sh | 30 ++++--- .../localhost-100y.cert | 34 ++++++++ .../localhost-100y.key | 52 +++++++++++ .../minimal-http-server.c | 9 +- minimal-examples/selftests-library.sh | 86 +++++++++++++++++++ minimal-examples/selftests.sh | 46 ++++++++++ .../minimal-ws-client-rx/minimal-ws-client.c | 13 ++- .../minimal-ws-client-rx/selftest.sh | 25 ++++++ scripts/travis_install.sh | 6 ++ 28 files changed, 486 insertions(+), 55 deletions(-) create mode 100755 minimal-examples/http-client/minimal-http-client-multi/selftest.sh create mode 100755 minimal-examples/http-client/minimal-http-client-post/selftest.sh create mode 100644 minimal-examples/http-server/minimal-http-server-libuv/localhost-100y.cert create mode 100644 minimal-examples/http-server/minimal-http-server-libuv/localhost-100y.key create mode 100755 minimal-examples/selftests-library.sh create mode 100755 minimal-examples/selftests.sh create mode 100644 minimal-examples/ws-client/minimal-ws-client-rx/selftest.sh diff --git a/.travis.yml b/.travis.yml index e89f39db2..6d2406902 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,7 +28,7 @@ install: # - Rscript -e 'covr::coveralls()' script: - - if [ "$COVERITY_SCAN_BRANCH" != 1 -a "$TRAVIS_OS_NAME" = "osx" ]; then mkdir build && cd build && cmake -DOPENSSL_ROOT_DIR="/usr/local/opt/openssl" $CMAKE_ARGS .. && cmake --build .; else if [ "$COVERITY_SCAN_BRANCH" != 1 -a "$TRAVIS_OS_NAME" = "linux" ]; then mkdir build && cd build && cmake $CMAKE_ARGS .. && cmake --build .; fi ; fi + - if [ "$COVERITY_SCAN_BRANCH" != 1 -a "$TRAVIS_OS_NAME" = "osx" ]; then mkdir build && cd build && cmake -DOPENSSL_ROOT_DIR="/usr/local/opt/openssl" $CMAKE_ARGS .. && cmake --build .; else if [ "$COVERITY_SCAN_BRANCH" != 1 -a "$TRAVIS_OS_NAME" = "linux" ]; then mkdir build && cd build && cmake $CMAKE_ARGS .. && cmake --build . && if [ "$LWS_METHOD" = "lwsws" ] ; then sudo make install && ../minimal-examples/selftests.sh ; fi ; fi ; fi sudo: required dist: trusty addons: diff --git a/lib/event-libs/libuv.c b/lib/event-libs/libuv.c index 984628e30..4db5155ff 100644 --- a/lib/event-libs/libuv.c +++ b/lib/event-libs/libuv.c @@ -359,7 +359,7 @@ lws_libuv_static_refcount_add(uv_handle_t *h, struct lws_context *context) LWS_VISIBLE void lws_libuv_static_refcount_del(uv_handle_t *h) { - return lws_uv_close_cb_sa(h); + lws_uv_close_cb_sa(h); } diff --git a/lib/libwebsockets.c b/lib/libwebsockets.c index 118a28a7b..fe2c5aabc 100644 --- a/lib/libwebsockets.c +++ b/lib/libwebsockets.c @@ -1060,7 +1060,7 @@ lws_buflist_use_segment(struct lws_buflist **head, size_t len) if (!*head) return 0; - return (*head)->len - (*head)->pos; + return (int)((*head)->len - (*head)->pos); } /* ... */ @@ -2671,7 +2671,7 @@ lws_create_adopt_udp(struct lws_vhost *vhost, int port, int flags, } if ((flags & LWS_CAUDP_BIND) && - bind(sock.sockfd, rp->ai_addr, rp->ai_addrlen) ==-1) { + bind(sock.sockfd, rp->ai_addr, rp->ai_addrlen) == -1) { lwsl_err("%s: bind failed\n", __func__); goto bail2; } @@ -2683,7 +2683,7 @@ lws_create_adopt_udp(struct lws_vhost *vhost, int port, int flags, bail2: if (!wsi) - close(sock.sockfd); + close((int)sock.sockfd); bail1: freeaddrinfo(r); @@ -2951,7 +2951,7 @@ lws_sum_stats(const struct lws_context *ctx, struct lws_conn_stats *cs) const char * lws_cmdline_option(int argc, const char **argv, const char *val) { - int n = strlen(val), c = argc; + int n = (int)strlen(val), c = argc; while (--c > 0) if (!strncmp(argv[c], val, n)) { diff --git a/lib/libwebsockets.h b/lib/libwebsockets.h index 7eb1b1ac3..2a9e92a36 100644 --- a/lib/libwebsockets.h +++ b/lib/libwebsockets.h @@ -1167,10 +1167,10 @@ enum lws_callback_reasons { LWS_CALLBACK_RECEIVE_CLIENT_HTTP_READ = 48, /**< This is generated by lws_http_client_read() used to drain - * incoming data. In the case the incoming data was chunked, - * it will be split into multiple smaller callbacks for each - * chunk block, removing the chunk headers. If not chunked, - * it will appear all in one callback. */ + * incoming data. In the case the incoming data was chunked, it will + * be split into multiple smaller callbacks for each chunk block, + * removing the chunk headers. If not chunked, it will appear all in + * one callback. */ LWS_CALLBACK_RECEIVE_CLIENT_HTTP = 46, /**< This simply indicates data was received on the HTTP client diff --git a/lib/roles/h2/http2.c b/lib/roles/h2/http2.c index 7ac2be679..dca0bd816 100644 --- a/lib/roles/h2/http2.c +++ b/lib/roles/h2/http2.c @@ -1992,8 +1992,8 @@ fail: int lws_h2_client_handshake(struct lws *wsi) { - uint8_t buf[LWS_PRE + 1024], *start = &buf[LWS_PRE], - *p = start, *end = &buf[sizeof(buf) - 1]; + struct lws_context_per_thread *pt = &wsi->context->pt[(int)wsi->tsi]; + uint8_t *buf, *start, *p, *end; char *meth = lws_hdr_simple_ptr(wsi, _WSI_TOKEN_CLIENT_METHOD), *uri = lws_hdr_simple_ptr(wsi, _WSI_TOKEN_CLIENT_URI); struct lws *nwsi = lws_get_network_wsi(wsi); @@ -2031,6 +2031,9 @@ lws_h2_client_handshake(struct lws *wsi) wsi->h2.peer_tx_cr_est += pps->u.update_window.credit; lws_pps_schedule(wsi, pps); + p = start = buf = pt->serv_buf + LWS_PRE; + end = start + wsi->context->pt_serv_buf_size - LWS_PRE - 1; + /* it's time for us to send our client stream headers */ if (!meth) @@ -2039,38 +2042,39 @@ lws_h2_client_handshake(struct lws *wsi) if (lws_add_http_header_by_token(wsi, WSI_TOKEN_HTTP_COLON_METHOD, (unsigned char *)meth, - strlen(meth), &p, end)) - return -1; + (int)strlen(meth), &p, end)) + goto fail_length; if (lws_add_http_header_by_token(wsi, WSI_TOKEN_HTTP_COLON_SCHEME, (unsigned char *)"http", 4, &p, end)) - return -1; + goto fail_length; if (lws_add_http_header_by_token(wsi, WSI_TOKEN_HTTP_COLON_PATH, (unsigned char *)uri, lws_hdr_total_length(wsi, _WSI_TOKEN_CLIENT_URI), &p, end)) - return -1; + goto fail_length; if (lws_add_http_header_by_token(wsi, WSI_TOKEN_HTTP_COLON_AUTHORITY, - (unsigned char *)lws_hdr_simple_ptr(wsi, _WSI_TOKEN_CLIENT_ORIGIN), + (unsigned char *)lws_hdr_simple_ptr(wsi, + _WSI_TOKEN_CLIENT_ORIGIN), lws_hdr_total_length(wsi, _WSI_TOKEN_CLIENT_ORIGIN), &p, end)) - return -1; + goto fail_length; /* give userland a chance to append, eg, cookies */ if (wsi->protocol->callback(wsi, LWS_CALLBACK_CLIENT_APPEND_HANDSHAKE_HEADER, wsi->user_space, &p, (end - p) - 12)) - return -1; + goto fail_length; if (lws_finalize_http_header(wsi, &p, end)) - return -1; + goto fail_length; n = lws_write(wsi, start, p - start, LWS_WRITE_HTTP_HEADERS); @@ -2084,6 +2088,11 @@ lws_h2_client_handshake(struct lws *wsi) lwsi_set_state(wsi, LRS_ESTABLISHED); return 0; + +fail_length: + lwsl_err("Client hdrs too long: extend context info.pt_serv_buf_size\n"); + + return -1; } int diff --git a/lib/roles/h2/ops-h2.c b/lib/roles/h2/ops-h2.c index 1cbf86b0f..15f33d7cb 100644 --- a/lib/roles/h2/ops-h2.c +++ b/lib/roles/h2/ops-h2.c @@ -177,7 +177,7 @@ rops_handle_POLLIN_h2(struct lws_context_per_thread *pt, struct lws *wsi, /* 3: RX Flowcontrol buffer / h2 rx scratch needs to be drained */ - eff_buf.token_len = lws_buflist_next_segment_len(&wsi->buflist_rxflow, + eff_buf.token_len = (int)lws_buflist_next_segment_len(&wsi->buflist_rxflow, (uint8_t **)&eff_buf.token); if (eff_buf.token_len) { lwsl_info("draining rxflow (len %d)\n", eff_buf.token_len); diff --git a/lib/roles/http/client/client.c b/lib/roles/http/client/client.c index e731befd8..3ba07b63a 100644 --- a/lib/roles/http/client/client.c +++ b/lib/roles/http/client/client.c @@ -937,7 +937,7 @@ bail2: if (wsi->protocol) { n = 0; if (cce) - n = strlen(cce); + n = (int)strlen(cce); wsi->protocol->callback(wsi, LWS_CALLBACK_CLIENT_CONNECTION_ERROR, wsi->user_space, (void *)cce, diff --git a/lib/roles/http/header.c b/lib/roles/http/header.c index 5a2900d51..1e17279b0 100644 --- a/lib/roles/http/header.c +++ b/lib/roles/http/header.c @@ -145,7 +145,7 @@ lws_add_http_common_headers(struct lws *wsi, unsigned int code, return 1; if (lws_add_http_header_by_token(wsi, WSI_TOKEN_HTTP_CONTENT_TYPE, (unsigned char *)content_type, - strlen(content_type), p, end)) + (int)strlen(content_type), p, end)) return 1; if (lws_add_http_header_content_length(wsi, content_len, p, end)) return 1; @@ -280,7 +280,7 @@ lws_return_http_status(struct lws *wsi, unsigned int code, /* we should do a redirect, and do the 404 there */ if (lws_http_redirect(wsi, HTTP_STATUS_FOUND, (uint8_t *)wsi->vhost->error_document_404, - strlen(wsi->vhost->error_document_404), + (int)strlen(wsi->vhost->error_document_404), &p, end) > 0) return 0; diff --git a/lib/roles/ws/ops-ws.c b/lib/roles/ws/ops-ws.c index fae43eadf..95bf7b1d8 100644 --- a/lib/roles/ws/ops-ws.c +++ b/lib/roles/ws/ops-ws.c @@ -941,7 +941,7 @@ rops_handle_POLLIN_ws(struct lws_context_per_thread *pt, struct lws *wsi, /* 3: RX Flowcontrol buffer / h2 rx scratch needs to be drained */ - eff_buf.token_len = lws_buflist_next_segment_len(&wsi->buflist_rxflow, + eff_buf.token_len = (int)lws_buflist_next_segment_len(&wsi->buflist_rxflow, (uint8_t **)&eff_buf.token); if (eff_buf.token_len) { lwsl_info("draining rxflow (len %d)\n", eff_buf.token_len); diff --git a/lib/service.c b/lib/service.c index b83587fa8..3468c9707 100644 --- a/lib/service.c +++ b/lib/service.c @@ -419,8 +419,8 @@ lws_service_do_ripe_rxflow(struct lws_context_per_thread *pt) pt->dll_head_rxflow.next) { struct lws *wsi = lws_container_of(d, struct lws, dll_rxflow); - pfd.events = POLLIN; - pfd.revents = POLLIN; + pfd.events = LWS_POLLIN; + pfd.revents = LWS_POLLIN; pfd.fd = -1; lwsl_debug("%s: rxflow processing: %p 0x%x\n", __func__, wsi, diff --git a/lib/tls/openssl/ssl.c b/lib/tls/openssl/ssl.c index 3f37a9bf7..b85567f28 100644 --- a/lib/tls/openssl/ssl.c +++ b/lib/tls/openssl/ssl.c @@ -619,7 +619,7 @@ lws_tls_openssl_cert_info(X509 *x509, enum lws_tls_cert_info type, return -1; } - buf->ns.len = klen; + buf->ns.len = (int)klen; memcpy(buf->ns.name, tmp, klen); OPENSSL_free(tmp); diff --git a/minimal-examples/http-client/minimal-http-client-certinfo/minimal-http-client-certinfo.c b/minimal-examples/http-client/minimal-http-client-certinfo/minimal-http-client-certinfo.c index f96b1d5ae..80e8dd540 100644 --- a/minimal-examples/http-client/minimal-http-client-certinfo/minimal-http-client-certinfo.c +++ b/minimal-examples/http-client/minimal-http-client-certinfo/minimal-http-client-certinfo.c @@ -101,6 +101,12 @@ callback_http(struct lws *wsi, enum lws_callback_reasons reason, lws_cancel_service(lws_get_context(wsi)); /* abort poll wait */ break; + case LWS_CALLBACK_CLOSED_CLIENT_HTTP: + client_wsi = NULL; + bad = status != 200; + lws_cancel_service(lws_get_context(wsi)); /* abort poll wait */ + break; + default: break; } diff --git a/minimal-examples/http-client/minimal-http-client-hugeurl/minimal-http-client-hugeurl.c b/minimal-examples/http-client/minimal-http-client-hugeurl/minimal-http-client-hugeurl.c index c50c0d6dd..12f100039 100644 --- a/minimal-examples/http-client/minimal-http-client-hugeurl/minimal-http-client-hugeurl.c +++ b/minimal-examples/http-client/minimal-http-client-hugeurl/minimal-http-client-hugeurl.c @@ -115,6 +115,12 @@ callback_http(struct lws *wsi, enum lws_callback_reasons reason, lws_cancel_service(lws_get_context(wsi)); /* abort poll wait */ break; + case LWS_CALLBACK_CLOSED_CLIENT_HTTP: + client_wsi = NULL; + bad = status != 200; + lws_cancel_service(lws_get_context(wsi)); /* abort poll wait */ + break; + default: break; } @@ -157,7 +163,7 @@ int main(int argc, const char **argv) signal(SIGINT, sigint_handler); lws_set_log_level(logs, NULL); - lwsl_user("LWS minimal http client hugeurl [-d [-l]\n"); + lwsl_user("LWS minimal http client hugeurl [-d ] [-l] [--h1]\n"); memset(&info, 0, sizeof info); /* otherwise uninitialized garbage */ info.options = LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT; @@ -190,6 +196,10 @@ int main(int argc, const char **argv) i.port = 443; i.address = "warmcat.com"; } + + if (lws_cmdline_option(argc, argv, "--h1")) + i.alpn = "http/1.1"; + i.path = uri; i.host = i.address; i.origin = i.address; diff --git a/minimal-examples/http-client/minimal-http-client-hugeurl/selftest.sh b/minimal-examples/http-client/minimal-http-client-hugeurl/selftest.sh index 9be3a8a7a..af8a4bcb1 100755 --- a/minimal-examples/http-client/minimal-http-client-hugeurl/selftest.sh +++ b/minimal-examples/http-client/minimal-http-client-hugeurl/selftest.sh @@ -7,17 +7,41 @@ # $2: path for logs and results. The results will go # in a subdir named after the directory this script # is in +# +# $3: offset for test index count +# +# $4: total test count +# +# $5: path to ./minimal-examples dir in lws +# +# Test return code 0: OK, 254: timed out, other: error indication -if [ -z "$1" -o -z "$2" ] ; then - echo "required args missing" - exit 1 +. $5/selftests-library.sh + +COUNT_TESTS=6 + +dotest $1 $2 warmcat +dotest $1 $2 warmcat-h1 --h1 + +spawn "" $5/http-server/minimal-http-server-tls $1/lws-minimal-http-server-tls +dotest $1 $2 localhost -l +spawn $SPID $5/http-server/minimal-http-server-tls $1/lws-minimal-http-server-tls +dotest $1 $2 localhost-h1 -l --h1 +kill $SPID 2>/dev/null +wait $SPID 2>/dev/null + + +if [ -z "$TRAVIS_OS_NAME" ] ; then + SPID="" + spawn "" $5/http-server/minimal-http-server-libuv $1/lws-minimal-http-server-libuv -s + dotest $1 $2 localhost-suv -l + spawn $SPID $5/http-server/minimal-http-server-libuv $1/lws-minimal-http-server-libuv -s + dotest $1 $2 localhost-suv-h1 -l --h1 + + kill $SPID 2>/dev/null + wait $SPID 2>/dev/null fi -MYTEST=`echo $0 | sed "s/\/[^\/]*\$//g" |sed "s/.*\///g"` -mkdir -p $2/$MYTEST -rm -f $2/$MYTEST/*.log $2/$MYTEST/*.result -$1/lws-$MYTEST > $2/$MYTEST/1.log 2> $2/$MYTEST/1.log -echo $? > $2/$MYTEST/1.result +exit $FAILS -exit 0 diff --git a/minimal-examples/http-client/minimal-http-client-multi/minimal-http-client-multi.c b/minimal-examples/http-client/minimal-http-client-multi/minimal-http-client-multi.c index 4508fb46e..d58ac1905 100644 --- a/minimal-examples/http-client/minimal-http-client-multi/minimal-http-client-multi.c +++ b/minimal-examples/http-client/minimal-http-client-multi/minimal-http-client-multi.c @@ -107,6 +107,22 @@ callback_http(struct lws *wsi, enum lws_callback_reasons reason, } break; + case LWS_CALLBACK_CLOSED_CLIENT_HTTP: + if (u && client_wsi[u->index]) { + /* + * If it completed normally, it will have been set to + * NULL then already. So we are dealing with an + * abnormal, failing, close + */ + client_wsi[u->index] = NULL; + failed++; + if (++completed == COUNT) { + lwsl_err("Done: failed: %d\n", failed); + interrupted = 1; + } + } + break; + default: break; } @@ -185,7 +201,7 @@ int main(int argc, const char **argv) info.options = LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT; info.port = CONTEXT_PORT_NO_LISTEN; /* we do not run any server */ info.protocols = protocols; - info.max_http_header_pool = 16; + info.max_http_header_pool = 20; info.h2_rx_scratch_size = 4096; /* trade h2 stream rx memory for speed */ #if defined(LWS_WITH_MBEDTLS) diff --git a/minimal-examples/http-client/minimal-http-client-multi/selftest.sh b/minimal-examples/http-client/minimal-http-client-multi/selftest.sh new file mode 100755 index 000000000..49d61a1b1 --- /dev/null +++ b/minimal-examples/http-client/minimal-http-client-multi/selftest.sh @@ -0,0 +1,52 @@ +#!/bin/bash +# +# $1: path to minimal example binaries... +# if lws is built with -DLWS_WITH_MINIMAL_EXAMPLES=1 +# that will be ./bin from your build dir +# +# $2: path for logs and results. The results will go +# in a subdir named after the directory this script +# is in +# +# $3: offset for test index count +# +# $4: total test count +# +# $5: path to ./minimal-examples dir in lws +# +# Test return code 0: OK, 254: timed out, other: error indication + +. $5/selftests-library.sh + +COUNT_TESTS=16 + +dotest $1 $2 warmcat +dotest $1 $2 warmcat-pipe -p +dotest $1 $2 warmcat-h1 --h1 +dotest $1 $2 warmcat-h1-pipe --h1 -p +dotest $1 $2 warmcat-stag -s +dotest $1 $2 warmcat-pipe-stag -p -s +dotest $1 $2 warmcat-h1-stag --h1 -s +dotest $1 $2 warmcat-h1-pipe-stag --h1 -p -s + +spawn "" $5/http-server/minimal-http-server-tls $1/lws-minimal-http-server-tls +dotest $1 $2 localhost -l +spawn $SPID $5/http-server/minimal-http-server-tls $1/lws-minimal-http-server-tls +dotest $1 $2 localhost-pipe -l -p +spawn $SPID $5/http-server/minimal-http-server-tls $1/lws-minimal-http-server-tls +dotest $1 $2 localhost-h1 -l --h1 +spawn $SPID $5/http-server/minimal-http-server-tls $1/lws-minimal-http-server-tls +dotest $1 $2 localhost-h1-pipe -l --h1 -p +spawn $SPID $5/http-server/minimal-http-server-tls $1/lws-minimal-http-server-tls +dotest $1 $2 localhost-stag -l -s +spawn $SPID $5/http-server/minimal-http-server-tls $1/lws-minimal-http-server-tls +dotest $1 $2 localhost-pipe-stag -l -p -s +spawn $SPID $5/http-server/minimal-http-server-tls $1/lws-minimal-http-server-tls +dotest $1 $2 localhost-h1-stag -l --h1 -s +spawn $SPID $5/http-server/minimal-http-server-tls $1/lws-minimal-http-server-tls +dotest $1 $2 localhost-h1-pipe-stag -l --h1 -p -s + +kill $SPID 2>/dev/null +wait $SPID 2>/dev/null +exit $FAILS + diff --git a/minimal-examples/http-client/minimal-http-client-post/minimal-http-client-post.c b/minimal-examples/http-client/minimal-http-client-post/minimal-http-client-post.c index d2406892d..0d7aedfaf 100644 --- a/minimal-examples/http-client/minimal-http-client-post/minimal-http-client-post.c +++ b/minimal-examples/http-client/minimal-http-client-post/minimal-http-client-post.c @@ -45,6 +45,12 @@ callback_http(struct lws *wsi, enum lws_callback_reasons reason, client_wsi = NULL; break; + case LWS_CALLBACK_CLOSED_CLIENT_HTTP: + client_wsi = NULL; + bad = status != 200; + lws_cancel_service(lws_get_context(wsi)); /* abort poll wait */ + break; + /* ...callbacks related to receiving the result... */ case LWS_CALLBACK_ESTABLISHED_CLIENT_HTTP: diff --git a/minimal-examples/http-client/minimal-http-client-post/selftest.sh b/minimal-examples/http-client/minimal-http-client-post/selftest.sh new file mode 100755 index 000000000..eeabeea14 --- /dev/null +++ b/minimal-examples/http-client/minimal-http-client-post/selftest.sh @@ -0,0 +1,33 @@ +#!/bin/bash +# +# $1: path to minimal example binaries... +# if lws is built with -DLWS_WITH_MINIMAL_EXAMPLES=1 +# that will be ./bin from your build dir +# +# $2: path for logs and results. The results will go +# in a subdir named after the directory this script +# is in +# +# $3: offset for test index count +# +# $4: total test count +# +# $5: path to ./minimal-examples dir in lws +# +# Test return code 0: OK, 254: timed out, other: error indication + +. $5/selftests-library.sh + +COUNT_TESTS=4 + +dotest $1 $2 warmcat +dotest $1 $2 warmcat-h1 --h1 + +spawn "" $5 $1/libwebsockets-test-server -s +dotest $1 $2 localhost -l +spawn $SPID $5 $1/libwebsockets-test-server -s +dotest $1 $2 localhost-h1 -l --h1 + +kill $SPID 2>/dev/null +wait $SPID 2>/dev/null +exit $FAILS diff --git a/minimal-examples/http-client/minimal-http-client/minimal-http-client.c b/minimal-examples/http-client/minimal-http-client/minimal-http-client.c index a0efb6477..4382647bd 100644 --- a/minimal-examples/http-client/minimal-http-client/minimal-http-client.c +++ b/minimal-examples/http-client/minimal-http-client/minimal-http-client.c @@ -72,6 +72,12 @@ callback_http(struct lws *wsi, enum lws_callback_reasons reason, lws_cancel_service(lws_get_context(wsi)); /* abort poll wait */ break; + case LWS_CALLBACK_CLOSED_CLIENT_HTTP: + client_wsi = NULL; + bad = status != 200; + lws_cancel_service(lws_get_context(wsi)); /* abort poll wait */ + break; + default: break; } diff --git a/minimal-examples/http-client/minimal-http-client/selftest.sh b/minimal-examples/http-client/minimal-http-client/selftest.sh index 9be3a8a7a..c065b444a 100755 --- a/minimal-examples/http-client/minimal-http-client/selftest.sh +++ b/minimal-examples/http-client/minimal-http-client/selftest.sh @@ -7,17 +7,27 @@ # $2: path for logs and results. The results will go # in a subdir named after the directory this script # is in +# +# $3: offset for test index count +# +# $4: total test count +# +# $5: path to ./minimal-examples dir in lws +# +# Test return code 0: OK, 254: timed out, other: error indication -if [ -z "$1" -o -z "$2" ] ; then - echo "required args missing" - exit 1 -fi +. $5/selftests-library.sh -MYTEST=`echo $0 | sed "s/\/[^\/]*\$//g" |sed "s/.*\///g"` -mkdir -p $2/$MYTEST -rm -f $2/$MYTEST/*.log $2/$MYTEST/*.result -$1/lws-$MYTEST > $2/$MYTEST/1.log 2> $2/$MYTEST/1.log -echo $? > $2/$MYTEST/1.result +COUNT_TESTS=4 -exit 0 +dotest $1 $2 warmcat +dotest $1 $2 warmcat-h1 --h1 +spawn "" $5/http-server/minimal-http-server-tls $1/lws-minimal-http-server-tls +dotest $1 $2 localhost -l +spawn $SPID $5/http-server/minimal-http-server-tls $1/lws-minimal-http-server-tls +dotest $1 $2 localhost-h1 -l --h1 + +kill $SPID 2>/dev/null +wait $SPID 2>/dev/null +exit $FAILS diff --git a/minimal-examples/http-server/minimal-http-server-libuv/localhost-100y.cert b/minimal-examples/http-server/minimal-http-server-libuv/localhost-100y.cert new file mode 100644 index 000000000..6f372db40 --- /dev/null +++ b/minimal-examples/http-server/minimal-http-server-libuv/localhost-100y.cert @@ -0,0 +1,34 @@ +-----BEGIN CERTIFICATE----- +MIIF5jCCA86gAwIBAgIJANq50IuwPFKgMA0GCSqGSIb3DQEBCwUAMIGGMQswCQYD +VQQGEwJHQjEQMA4GA1UECAwHRXJld2hvbjETMBEGA1UEBwwKQWxsIGFyb3VuZDEb +MBkGA1UECgwSbGlid2Vic29ja2V0cy10ZXN0MRIwEAYDVQQDDAlsb2NhbGhvc3Qx +HzAdBgkqhkiG9w0BCQEWEG5vbmVAaW52YWxpZC5vcmcwIBcNMTgwMzIwMDQxNjA3 +WhgPMjExODAyMjQwNDE2MDdaMIGGMQswCQYDVQQGEwJHQjEQMA4GA1UECAwHRXJl +d2hvbjETMBEGA1UEBwwKQWxsIGFyb3VuZDEbMBkGA1UECgwSbGlid2Vic29ja2V0 +cy10ZXN0MRIwEAYDVQQDDAlsb2NhbGhvc3QxHzAdBgkqhkiG9w0BCQEWEG5vbmVA +aW52YWxpZC5vcmcwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCjYtuW +aICCY0tJPubxpIgIL+WWmz/fmK8IQr11Wtee6/IUyUlo5I602mq1qcLhT/kmpoR8 +Di3DAmHKnSWdPWtn1BtXLErLlUiHgZDrZWInm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2cKk +ujC3rMdFTtte83wF1uuF4FjUC72+SmcQN7A386BC/nk2TTsJawTDzqwOu/VdZv2g +1WpTHlumlClZeP+G/jkSyDwqNnTu1aodDmUa4xZodfhP1HWPwUKFcq8oQr148QYA +AOlbUOJQU7QwRWd1VbnwhDtQWXC92A2w1n/xkZSR1BM/NUSDhkBSUU1WjMbWg6Gg +mnIZLRerQCu1Oozr87rOQqQakPkyt8BUSNK3K42j2qcfhAONdRl8Hq8Qs5pupy+s +8sdCGDlwR3JNCMv6u48OK87F4mcIxhkSefFJUFII25pCGN5WtE4p5l+9cnO1GrIX +e2Hl/7M0c/lbZ4FvXgARlex2rkgS0Ka06HE= +-----END CERTIFICATE----- diff --git a/minimal-examples/http-server/minimal-http-server-libuv/localhost-100y.key b/minimal-examples/http-server/minimal-http-server-libuv/localhost-100y.key new file mode 100644 index 000000000..148f8598e --- /dev/null +++ b/minimal-examples/http-server/minimal-http-server-libuv/localhost-100y.key @@ -0,0 +1,52 @@ +-----BEGIN PRIVATE KEY----- +MIIJQwIBADANBgkqhkiG9w0BAQEFAASCCS0wggkpAgEAAoICAQCjYtuWaICCY0tJ +PubxpIgIL+WWmz/fmK8IQr11Wtee6/IUyUlo5I602mq1qcLhT/kmpoR8Di3DAmHK +nSWdPWtn1BtXLErLlUiHgZDrZWInmEBjKM1DZf+CvNGZ+EzPgBv5nTekLWcfI5ZZ +toGuIP1Dl/IkNDw8zFz4cpiMe/BFGemyxdHhLrKHSm8Eo+nT734tItnHKT/m6DSU +0xlZ13d6ehLRm7/+Nx47M3XMTRH5qKP/7TTE2s0U6+M0tsGI2zpRi+m6jzhNyMBT +J1u58qAe3ZW5/+YAiuZYAB6n5bhUp4oFuB5wYbcBywVR8ujInpF8buWQUjy5N8pS +Np7szdYsnLJpvAd0sibrNPjC0FQCNrpNjgJmIK3+mKk4kXX7ZTwefoAzTK4l2pHN +uC53QVc/EF++GBLAxmvCDq9ZpMIYi7OmzkkAKKC9Ue6Ef217LFQCFIBKIzv9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DN5 +SYt4tr2uPEe53NTXuSatilG5QCyExIELOuzWAMKzg7CAiIlNS9foWeLyVkBgCQ6S +me/L8ta+mUDy37K6vC34jh9vK9yrwF6X44ItRoOJafCaVfGI+175q/eWcqTX4q+I +G4tKls4sL4mgOJLq+ra50aYMxbcuommctPMXU6CrrYyQpPTHMNVDQy2ttFdsq9iK +TncCggEBAMmt/8yvPflS+xv3kg/ZBvR9JB1In2n3rUCYYD47ReKFqJ03Vmq5C9nY +56s9w7OUO8perBXlJYmKZQhO4293lvxZD2Iq4NcZbVSCMoHAUzhzY3brdgtSIxa2 +gGveGAezZ38qKIU26dkz7deECY4vrsRkwhpTW0LGVCpjcQoaKvymAoCmAs8V2oMr +Ziw1YQ9uOUoWwOqm1wZqmVcOXvPIS2gWAs3fQlWjH9hkcQTMsUaXQDOD0aqkSY3E +NqOvbCV1/oUpRi3076khCoAXI1bKSn/AvR3KDP14B5toHI/F5OTSEiGhhHesgRrs +fBrpEY1IATtPq1taBZZogRqI3rOkkPk= +-----END PRIVATE KEY----- diff --git a/minimal-examples/http-server/minimal-http-server-libuv/minimal-http-server.c b/minimal-examples/http-server/minimal-http-server-libuv/minimal-http-server.c index f93e651a5..e6e66185e 100644 --- a/minimal-examples/http-server/minimal-http-server-libuv/minimal-http-server.c +++ b/minimal-examples/http-server/minimal-http-server-libuv/minimal-http-server.c @@ -71,13 +71,18 @@ int main(int argc, const char **argv) logs = atoi(p); lws_set_log_level(logs, NULL); - lwsl_user("LWS minimal http server libuv | visit http://localhost:7681\n"); + lwsl_user("LWS minimal http server libuv [-s (ssl)] | visit http://localhost:7681\n"); memset(&info, 0, sizeof info); /* otherwise uninitialized garbage */ info.port = 7681; info.mounts = &mount; info.error_document_404 = "/404.html"; - info.options = LWS_SERVER_OPTION_LIBUV; + if (lws_cmdline_option(argc, argv, "-s")) { + info.options |= LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT; + info.ssl_cert_filepath = "localhost-100y.cert"; + info.ssl_private_key_filepath = "localhost-100y.key"; + } + info.options |= LWS_SERVER_OPTION_LIBUV; context = lws_create_context(&info); if (!context) { diff --git a/minimal-examples/selftests-library.sh b/minimal-examples/selftests-library.sh new file mode 100755 index 000000000..13f34ddeb --- /dev/null +++ b/minimal-examples/selftests-library.sh @@ -0,0 +1,86 @@ + +if [ -z "$1" -o -z "$2" ] ; then + echo "required args missing" + exit 1 +fi + +IDX=$3 +TOT=$4 +MYTEST=`echo $0 | sed "s/\/[^\/]*\$//g" |sed "s/.*\///g"` +mkdir -p $2/$MYTEST +rm -f $2/$MYTEST/*.log $2/$MYTEST/*.result +FAILS=0 +WHICH=$IDX +SPID= +SCRIPT_DIR=`dirname $0` +SCRIPT_DIR=`readlink -f $SCRIPT_DIR` +LOGPATH=$2 + +feedback() { + if [ "$2" != "0" ] ; then + FAILS=$(( $FAILS + 1 )) + echo -n -e "\e[31m" + fi + T=" --- killed --- " + if [ ! -z "`cat $LOGPATH/$MYTEST/$3.time`" ] ; then + T="`cat $LOGPATH/$MYTEST/$3.time | grep real | sed "s/.*\ //g"`" + T="$T `cat $LOGPATH/$MYTEST/$3.time | grep user | sed "s/.*\ //g"`" + T="$T `cat $LOGPATH/$MYTEST/$3.time | grep sys | sed "s/.*\ //g"`" + fi + printf "%-35s [ %3s/%3s ]: %3s : %8s : %s\n" $1 $WHICH $TOT $2 "$T" $3 + if [ "$2" != "0" ] ; then + echo -n -e "\e[0m" + fi + WHICH=$(( $WHICH + 1)) +} + +spawn() { + if [ ! -z "$1" ] ; then + if [ `ps $1 | wc -l` -eq 2 ]; then +# echo "prerequisite still up" + return 0 + fi + fi + + cd $SCRIPT_DIR + cd $2 + $3 $4 $5 > $LOGPATH/$MYTEST/serverside.log 2> $LOGPATH/$MYTEST/serverside.log & + SPID=$! + sleep 0.5s +# echo "launched prerequisite $SPID" +} + +dotest() { + T=$3 + ( + { + /usr/bin/time -p $1/lws-$MYTEST $4 $5 $6 $7 > $2/$MYTEST/$T.log 2> $2/$MYTEST/$T.log ; + echo $? > $2/$MYTEST/$T.result + } 2> $2/$MYTEST/$T.time >/dev/null + ) >/dev/null 2> /dev/null & + W=$! + WT=0 + while [ $WT -le 220 ] ; do + kill -0 $W 2>/dev/null + if [ $? -ne 0 ] ; then + WT=10000 + else + if [ $WT -ge 200 ] ; then + WT=10000 + kill $W 2>/dev/null + wait $W 2>/dev/null + fi + fi + sleep 0.1s + WT=$(( $WT + 1 )) + done + + R=254 + if [ -e $2/$MYTEST/$T.result ] ; then + R=`cat $2/$MYTEST/$T.result` + cat $2/$MYTEST/$T.log | tail -n 3 > $2/$MYTEST/$T.time + fi + + feedback $MYTEST $R $T +} + diff --git a/minimal-examples/selftests.sh b/minimal-examples/selftests.sh new file mode 100755 index 000000000..a3f97033e --- /dev/null +++ b/minimal-examples/selftests.sh @@ -0,0 +1,46 @@ +#/bin/bash +# +# run this from your build dir having configured +# -DLWS_WITH_MINIMAL_EXAMPLES=1 to get all the examples +# that apply built into ./bin +# +# Eg, +# +# build $ ../minimal-examples/selftests.sh + +LOGGING_PATH=/tmp/logs + + +MINEX=`dirname $0` +MINEX=`realpath $MINEX` +TESTS=0 +for i in `find $MINEX -name selftest.sh` ; do + C=`cat $i | grep COUNT_TESTS= | cut -d= -f2` + TESTS=$(( $TESTS + $C )) +done + +FAILS=0 +WH=1 + +for i in `find $MINEX -name selftest.sh` ; do + C=`cat $i | grep COUNT_TESTS= | cut -d= -f2` + sh $i `pwd`/bin $LOGGING_PATH $WH $TESTS $MINEX + FAILS=$(( $FAILS + $? )) + + L=`ps fax | grep lws- | cut -d' ' -f2` + kill $L 2>/dev/null + kill -9 $L 2>/dev/null + wait $L 2>/dev/null + + WH=$(( $WH + $C )) +done + +if [ $FAILS -eq 0 ] ; then + echo "All $TESTS passed" + exit 0 +else + echo "Failed: $FAILS / $TESTS" + exit 1 +fi + + diff --git a/minimal-examples/ws-client/minimal-ws-client-rx/minimal-ws-client.c b/minimal-examples/ws-client/minimal-ws-client-rx/minimal-ws-client.c index a367e1914..c3cdabf4b 100644 --- a/minimal-examples/ws-client/minimal-ws-client-rx/minimal-ws-client.c +++ b/minimal-examples/ws-client/minimal-ws-client-rx/minimal-ws-client.c @@ -18,7 +18,7 @@ #include #include -static int interrupted; +static int interrupted, rx_seen, test; static struct lws *client_wsi; static int @@ -40,6 +40,9 @@ callback_dumb_increment(struct lws *wsi, enum lws_callback_reasons reason, case LWS_CALLBACK_CLIENT_RECEIVE: lwsl_user("RX: %s\n", (const char *)in); + rx_seen++; + if (test && rx_seen == 10) + interrupted = 1; break; case LWS_CALLBACK_CLIENT_CLOSED: @@ -87,8 +90,10 @@ int main(int argc, const char **argv) if ((p = lws_cmdline_option(argc, argv, "-d"))) logs = atoi(p); + test = !!lws_cmdline_option(argc, argv, "-t"); + lws_set_log_level(logs, NULL); - lwsl_user("LWS minimal ws client rx [-d ] [--h2]\n"); + lwsl_user("LWS minimal ws client rx [-d ] [--h2] [-t (test)]\n"); memset(&info, 0, sizeof info); /* otherwise uninitialized garbage */ info.options = LWS_SERVER_OPTION_DO_SSL_GLOBAL_INIT; @@ -129,7 +134,7 @@ int main(int argc, const char **argv) lws_context_destroy(context); - lwsl_user("Completed\n"); + lwsl_user("Completed %s\n", rx_seen > 10 ? "OK" : "Failed"); - return 0; + return rx_seen > 10; } diff --git a/minimal-examples/ws-client/minimal-ws-client-rx/selftest.sh b/minimal-examples/ws-client/minimal-ws-client-rx/selftest.sh new file mode 100644 index 000000000..070ef7f35 --- /dev/null +++ b/minimal-examples/ws-client/minimal-ws-client-rx/selftest.sh @@ -0,0 +1,25 @@ +#!/bin/bash +# +# $1: path to minimal example binaries... +# if lws is built with -DLWS_WITH_MINIMAL_EXAMPLES=1 +# that will be ./bin from your build dir +# +# $2: path for logs and results. The results will go +# in a subdir named after the directory this script +# is in +# +# $3: offset for test index count +# +# $4: total test count +# +# $5: path to ./minimal-examples dir in lws +# +# Test return code 0: OK, 254: timed out, other: error indication + +. $5/selftests-library.sh + +COUNT_TESTS=1 + +dotest $1 $2 warmcat -t + +exit $FAILS diff --git a/scripts/travis_install.sh b/scripts/travis_install.sh index f7695bb09..c74d37382 100755 --- a/scripts/travis_install.sh +++ b/scripts/travis_install.sh @@ -6,6 +6,11 @@ if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get update -qq + if [ "$LWS_METHOD" == "lwsws" ]; + then + sudo apt-get install -y -qq realpath; + fi + if [ "$LWS_METHOD" == "libev" ]; then sudo apt-get install -y -qq libev-dev; @@ -14,6 +19,7 @@ then if [ "$LWS_METHOD" == "libuv" -o "$LWS_METHOD" == "lwsws" ]; then sudo apt-get install -y -qq libuv-dev; +#libuv1 libuv1-dev; fi fi